profile
viewpoint
Nicholas Nethercote nnethercote Mozilla Melbourne, Australia he/him

mozilla/sccache 1520

sccache is ccache with cloud storage

dtolnay/cargo-llvm-lines 119

Count lines of LLVM IR per generic function

nnethercote/counts 38

A tool for ad hoc profiling

mozilla/dump_syms 15

Rewrite of breakpad dump_syms tools in Rust

mozilla/fix-stacks 13

This program post-processes the stack frames produced by `MozFormatCodeAddress()`.

nnethercote/pdf.js 1

PDF Reader in JavaScript

nnethercote/angle 0

Clone of https://chromium.googlesource.com/angle/angle with Gecko-specific patches. Talk to vlad, jgilbert, or kamidphish for more info.

nnethercote/B2G 0

Boot to Gecko aims to create a complete, standalone operating system for the open web.

nnethercote/cargo 0

The Rust package manager

delete branch nnethercote/rust

delete branch : tweak-confusable-idents-checking

delete time in 7 hours

Pull request review commentrust-lang/rust

Inlined symbols

 impl Symbol {     } } +// These `Symbol` methods are for accessing symbols via `SESSION_GLOBALS`.+impl Symbol {+    /// Map a string to its symbol representation, using the interner's table+    /// from `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn intern(string: &str) -> Self {+        if let Some(sym) = Symbol::try_new_inlined(string) {+            sym+        } else {+            with_interner(|interner| interner.intern(string))+        }+    }++    /// Access the symbol's chars, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn with<F: FnOnce(&str) -> R, R>(self, f: F) -> R {+        f(self.as_str().deref())+    }++    /// Convert to a `SymbolStr`, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn as_str(self) -> SymbolStr {

Aha, I can fix the sort problems by switching from sort_by_key to sort_by.

nnethercote

comment created time in a day

pull request commentrust-lang/rust

Tweak confusable idents checking

These two commits are the first two commits from #74554.

nnethercote

comment created time in a day

delete branch nnethercote/rust

delete branch : rm-ast-session-globals

delete time in a day

PR opened rust-lang/rust

Tweak confusable idents checking

The confusable idents checking does some sub-optimal things with symbols.

r? @petrochenkov cc @crlf0710

+43 -65

0 comment

4 changed files

pr created time in a day

create barnchnnethercote/rust

branch : tweak-confusable-idents-checking

created branch time in a day

push eventnnethercote/rust

Lzu Tao

commit sha a5d0c2c17482e56cae5112083207e8c0ce19cb96

Remove redundant len binding

view details

Lzu Tao

commit sha 34c343ac27c519350577bd1bfdc4d1a3b90e6db6

Make use of macro to avoid repetition

view details

Lzu Tao

commit sha f55e4d036c10f5b887b4ed8c12b7b31f3bb75d23

Get pointer from address of c directly

view details

Stefan Lankes

commit sha a4fb1d0b76a6e4e5e980a6839eb318a879635882

adjust remaining targets - fix commit 7dc3886 - previous commit doesn't adjust all targets

view details

Aaron Hill

commit sha 1f63a6a572a0f9afc769a88229d80cc81ff04697

Hash parent ExpnData

view details

Aaron Hill

commit sha 955aebf529787fd49b05f07346e3de97da31cb09

Don't serialize ExpnData for foreign crates When we encode an ExpnId into the crate metadata, we write out the CrateNum of the crate that 'owns' the corresponding `ExpnData`, which is later used to decode the `ExpnData` from its owning crate. However, we current serialize the `ExpnData` for all `ExpnIds` that we serialize, even if the `ExpnData` was already serialized into a foreign crate. This commit skips encoding this kind of `ExpnData`, which should hopefully speed up metadata encoding and reduce the total metadata size.

view details

Ivan Tham

commit sha e1ef3fa686040a8c9aba34dd954a7ff7227a23ee

Consistent variable name alloc for raw_vec

view details

Alexis Bourget

commit sha d243fa109fd22d334a717e4f03bf208ce9c3a9f4

Fix the documentation for move about Fn traits implementations

view details

Bastian Kauschke

commit sha 375bccb8b3fa2a517e6e19e24da25cad0413987d

add min_const_generics feature gate

view details

Bastian Kauschke

commit sha 289e5fca7ecdb03db97be9d89ae908f253a3f263

forbid generic params in complex consts

view details

Bastian Kauschke

commit sha 188bbf840dd858edb929459bd3536219fa062077

forbid complex types for generic parameters

view details

Bastian Kauschke

commit sha a5a5ca0da8cd536c0d6b2e7eb7da6304047dc750

add tracking issue

view details

Bastian Kauschke

commit sha 0d54f571c10dbc7e6d8632698c5f08f77b4a7578

impl review

view details

Tim Diekmann

commit sha a784729cde2f558bba91984eadf0f152b8a9d288

Add `as_mut_ptr` to `NonNull<[T]>`

view details

Aaron Hill

commit sha bbcacddef691464e5abe373f95849670298c63a7

Don't call a function in function-arguments-naked.rs Fixes #75096 It's U.B. to use anything other than inline assmebling in a naked function. Fortunately, the `#break` directive works fine without anything in the function body.

view details

Bastian Kauschke

commit sha 37c29adabc638f9c601daf5b78d0f6de63e35f99

allow complex expressions in assoc consts

view details

Bastian Kauschke

commit sha 644c8949121da0c16f65b772bf6e217748d94530

test min_const_generics using revisions

view details

Ralf Jung

commit sha 0aee186723a3bb3290fd4348b92b3c1aad862fc9

make MaybeUninit::as_(mut_)ptr const

view details

Ralf Jung

commit sha ec5d78d35004846f1d0c344e968eaf0068a68357

fix feature gate and tracking issue

view details

Nazım Can Altınova

commit sha e31116af50f35ff81f83561ba607c610f42bbf4a

Add `into_{keys,values}` methods for HashMap

view details

push time in a day

pull request commentrust-lang/rust

Update hashbrown to 0.8.2

Perf results from the landing. A bit weird; lots of improvements but some regressions as well, most in the incr-patched runs. I'm disappointed it's not a clearer and more uniform win.

Amanieu

comment created time in 2 days

pull request commentrust-lang/rust

Inlined symbols

@petrochenkov: thank you for doing #75309. I had though that a proc macro could probably improve the keyword categorization, but I didn't have the gumption to do it myself.

I am on PTO for the next two weeks so I won't get to this until after that. I'm still ambivalent about this, particularly because of my uncertainty in https://github.com/rust-lang/rust/pull/74554#discussion_r466844042. If I had to choose between eliminating SymbolStr or getting the small speedup from inlined symbols, I'd probably choose the former...

nnethercote

comment created time in 2 days

pull request commentrust-lang/rust

rustc_span: Generate keyword classification functions automatically

Yeah, maybe we shouldn't land this until we are certain about #74554?

petrochenkov

comment created time in 2 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I added the 256 recursion limit.

@bors r=petrochenkov

nnethercote

comment created time in 3 days

push eventnnethercote/rust

Andy Russell

commit sha af88ce5eb34b0ecdfd2f8dfcc837c353688d6c75

allow aux builds in rustdoc-ui mode

view details

Andy Russell

commit sha 608807934d41168cb30c6eee6442fe29251e40f0

use outermost invocation span for doctest names Fixes #70090.

view details

Oliver Scherer

commit sha c3454c000706176b61ef089107203766735348f7

Check whether locals are too large instead of whether accesses into them are too large

view details

Oliver Scherer

commit sha b26a7d5cd9d9c9ec84eba90b806a453135d20b99

Stop propagating to locals that were marks as unpropagatable. We used to erase these values immediately after propagation, but some things slipped through and it caused us to still initialize huge locals.

view details

Oliver Scherer

commit sha 9e21004c74b8749686c0e5b9195e6822be6280d0

Update ui tests

view details

Oliver Scherer

commit sha 8d5f2bdcd17f3139965b9ef6da8cb13183324485

Add test ensuring that we don't propagate large arrays

view details

Oliver Scherer

commit sha dc0408ec43fa6b63b5cbffbbc07823577c97ea24

Update clippy ui test. The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.

view details

Oliver Scherer

commit sha f7a1e64fdb209951e6e77369364feb530a60b04c

Update tests after rebase

view details

Oliver Scherer

commit sha 1864a973b3a0a5a6c5a7c71d7d7cd052732e5c02

Improve the diagnostics around misspelled mir dump filenames

view details

Ximin Luo

commit sha 7f54cf26511b2716d35e2f2198bbff9da5a33123

compiletest: ignore-endian-big, fixes #74829, fixes #74885

view details

Joshua Nelson

commit sha 8e0e925e2bd45806f88195a94e59246e2e5b6d5e

Disallow linking to items with a mismatched disambiguator

view details

Joshua Nelson

commit sha 519c85439a39d85d0c4b08ff8622cad5bd707ada

Don't mark associated items as traits This caused the following false positive: ``` warning: unresolved link to `Default::default` --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(broken_intra_doc_links)]` on by default note: this item resolved to a trait, which did not match the disambiguator 'fn' --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ ```

view details

Joshua Nelson

commit sha 743f9327428801932bd70688b5c83f38bf61615a

Keep the previous behavior of `register_res` Now that we're returning the `Res` of the associated item, not the trait itself, it got confused.

view details

oliver-giersch

commit sha 6c81556a36ac5507fe1f9cd8ee699e6fa2b11077

adds [*mut|*const] ptr::set_ptr_value

view details

Joshua Nelson

commit sha 99354f552df332c669d6e621e68dda403ea135fd

item -> link

view details

Tomasz Miąsko

commit sha 427634b5037ba1c00b72b70b561ff20767ea97e2

Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code.

view details

Joshua Nelson

commit sha 444f5a0556fc5779663e69ff1a3d5a7362ba9618

Give a much better error message if the struct failed to resolve

view details

Joshua Nelson

commit sha fc273a035dfb352fd90246dd2560c807701eeea7

Unresolved link -> incompatible link kind Clearly it has been resolved, because we say on the next line what it resolved to.

view details

Lzu Tao

commit sha 725d37cae0a175edb0c013b3de5b337ce5b5054d

Make doctests of Ipv4Addr::from(u32) easier to read

view details

Lzu Tao

commit sha d9f260e95efcb3ada02d1cd85d304438de8af294

Remove unused FromInner impl for Ipv4Addr

view details

push time in 3 days

push eventnnethercote/rust

Andy Russell

commit sha af88ce5eb34b0ecdfd2f8dfcc837c353688d6c75

allow aux builds in rustdoc-ui mode

view details

Andy Russell

commit sha 608807934d41168cb30c6eee6442fe29251e40f0

use outermost invocation span for doctest names Fixes #70090.

view details

Oliver Scherer

commit sha c3454c000706176b61ef089107203766735348f7

Check whether locals are too large instead of whether accesses into them are too large

view details

Oliver Scherer

commit sha b26a7d5cd9d9c9ec84eba90b806a453135d20b99

Stop propagating to locals that were marks as unpropagatable. We used to erase these values immediately after propagation, but some things slipped through and it caused us to still initialize huge locals.

view details

Oliver Scherer

commit sha 9e21004c74b8749686c0e5b9195e6822be6280d0

Update ui tests

view details

Oliver Scherer

commit sha 8d5f2bdcd17f3139965b9ef6da8cb13183324485

Add test ensuring that we don't propagate large arrays

view details

Oliver Scherer

commit sha dc0408ec43fa6b63b5cbffbbc07823577c97ea24

Update clippy ui test. The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.

view details

Oliver Scherer

commit sha f7a1e64fdb209951e6e77369364feb530a60b04c

Update tests after rebase

view details

Oliver Scherer

commit sha 1864a973b3a0a5a6c5a7c71d7d7cd052732e5c02

Improve the diagnostics around misspelled mir dump filenames

view details

Ximin Luo

commit sha 7f54cf26511b2716d35e2f2198bbff9da5a33123

compiletest: ignore-endian-big, fixes #74829, fixes #74885

view details

Joshua Nelson

commit sha 8e0e925e2bd45806f88195a94e59246e2e5b6d5e

Disallow linking to items with a mismatched disambiguator

view details

Joshua Nelson

commit sha 519c85439a39d85d0c4b08ff8622cad5bd707ada

Don't mark associated items as traits This caused the following false positive: ``` warning: unresolved link to `Default::default` --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(broken_intra_doc_links)]` on by default note: this item resolved to a trait, which did not match the disambiguator 'fn' --> /home/joshua/rustc2/default.rs:1:14 | 1 | /// Link to [Default::default()] | ^^^^^^^^^^^^^^^^^^ ```

view details

Joshua Nelson

commit sha 743f9327428801932bd70688b5c83f38bf61615a

Keep the previous behavior of `register_res` Now that we're returning the `Res` of the associated item, not the trait itself, it got confused.

view details

oliver-giersch

commit sha 6c81556a36ac5507fe1f9cd8ee699e6fa2b11077

adds [*mut|*const] ptr::set_ptr_value

view details

Joshua Nelson

commit sha 99354f552df332c669d6e621e68dda403ea135fd

item -> link

view details

Tomasz Miąsko

commit sha 427634b5037ba1c00b72b70b561ff20767ea97e2

Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code.

view details

Joshua Nelson

commit sha 444f5a0556fc5779663e69ff1a3d5a7362ba9618

Give a much better error message if the struct failed to resolve

view details

Joshua Nelson

commit sha fc273a035dfb352fd90246dd2560c807701eeea7

Unresolved link -> incompatible link kind Clearly it has been resolved, because we say on the next line what it resolved to.

view details

Lzu Tao

commit sha 725d37cae0a175edb0c013b3de5b337ce5b5054d

Make doctests of Ipv4Addr::from(u32) easier to read

view details

Lzu Tao

commit sha d9f260e95efcb3ada02d1cd85d304438de8af294

Remove unused FromInner impl for Ipv4Addr

view details

push time in 3 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

It's a weird rustdoc failure I haven't seen before, only on one of the linux platforms:

error[E0275]: overflow evaluating the requirement `alloc::raw_vec::RawVec<(rustc_ast::ast::UseTree, rustc_ast::ast::NodeId)>: std::marker::Sync`
  |
  = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustc_plugin_impl`)
  = note: required because it appears within the type `std::vec::Vec<(rustc_ast::ast::UseTree, rustc_ast::ast::NodeId)>`
  = note: required because it appears within the type `rustc_ast::ast::UseTreeKind`
  ... <lots more lines like that> ...

This is while running rustdoc on the rustc_plugin_impl module. That seems unrelated to my changes, unless we happened to be really close to the recursion limit previously and my patch changed enough things to tip it over the limit?

I'm not sure what to do here, whether it's spurious and likely to disappear if we try again, or if it's likely to recur. If it's the latter, I guess I should add the recusion_limit="256" like the message suggests?

@jyn514, any ideas?

nnethercote

comment created time in 3 days

pull request commentrust-lang/hashbrown

Avoid closures to improve compile times.

@Amanieu: I know that hashbrown was just upgraded in std to 0.8.1, but I think it would be worth doing a 0.8.2 release with this change so that the compile time benefits can be spread widely?

nnethercote

comment created time in 3 days

delete branch nnethercote/hashbrown

delete branch : avoid-closures

delete time in 3 days

push eventnnethercote/hashbrown

Nicholas Nethercote

commit sha e47bec1556af7c1708878fef01c7365d0f9ab306

Avoid closures to improve compile times. `HashMap` and `HashSet` are used widely, and often instantiated many times. As a result, small differences in how the code is written can have a significant effect on how much LLVM IR is generated, which affects compile times. This commit avoids a lot of small closures by replacing calls to `Option::map`, `Option::ok_or_else`, `Option::unwrap_or_else` and `Result::unwrap_or_else` with `match` expressions. Although this makes the code less concise, it improves compile times. For example, several of the benchmarks in rustc-perf compile up to 3.5% faster after this change is incorporated into std. Every change is accompanied by a short comment to explain why a `match` is used. This may seem excessive, but without these comments it would be easy for a well-meaning person in the future to change some or all of these back to the original versions without understanding the consequences.

view details

push time in 4 days

pull request commentrust-lang/hashbrown

Avoid closures to improve compile times.

Here are some measurements from my Linux box, measuring full (non-incremental) builds for the "real-world" benchmarks in rustc-perf.

cargo-debug
        avg: -3.5%      min: -3.5%      max: -3.5%
webrender-wrench-debug
        avg: -2.8%      min: -2.8%      max: -2.8%
regex-debug
        avg: -2.7%      min: -2.7%      max: -2.7%
webrender-debug
        avg: -2.7%      min: -2.7%      max: -2.7%
tokio-webpush-simple-debug
        avg: -1.9%      min: -1.9%      max: -1.9%
webrender-opt
        avg: -1.9%      min: -1.9%      max: -1.9%
piston-image-debug
        avg: -1.4%      min: -1.4%      max: -1.4%
cranelift-codegen-debug
        avg: -1.3%      min: -1.3%      max: -1.3%
cargo-opt
        avg: -1.3%      min: -1.3%      max: -1.3%
ripgrep-debug
        avg: -1.3%      min: -1.3%      max: -1.3%
clap-rs-debug
        avg: -1.2%      min: -1.2%      max: -1.2%
clap-rs-opt
        avg: -1.2%      min: -1.2%      max: -1.2%
html5ever-debug
        avg: -1.1%      min: -1.1%      max: -1.1%
html5ever-opt
        avg: -1.0%      min: -1.0%      max: -1.0%
syn-debug
        avg: -1.0%      min: -1.0%      max: -1.0%
regex-opt
        avg: 1.0%       min: 1.0%       max: 1.0%
cranelift-codegen-opt
        avg: -0.9%      min: -0.9%      max: -0.9%
hyper-2-debug
        avg: -0.8%      min: -0.8%      max: -0.8%
serde-check
        avg: -0.8%      min: -0.8%      max: -0.8%
futures-debug
        avg: -0.8%      min: -0.8%      max: -0.8%
serde-debug
        avg: -0.8%      min: -0.8%      max: -0.8%
serde-opt
        avg: -0.7%      min: -0.7%      max: -0.7%
futures-check
        avg: -0.6%      min: -0.6%      max: -0.6%
clap-rs-check
        avg: -0.6%      min: -0.6%      max: -0.6%
ripgrep-opt
        avg: -0.6%      min: -0.6%      max: -0.6%
tokio-webpush-simple-opt
        avg: -0.6%      min: -0.6%      max: -0.6%
piston-image-opt
        avg: -0.5%      min: -0.5%      max: -0.5%
cargo-check
        avg: -0.5%      min: -0.5%      max: -0.5%
syn-opt
        avg: -0.5%?     min: -0.5%?     max: -0.5%?
hyper-2-check
        avg: -0.5%      min: -0.5%      max: -0.5%
webrender-wrench-opt
        avg: -0.4%      min: -0.4%      max: -0.4%
html5ever-check
        avg: -0.4%      min: -0.4%      max: -0.4%
hyper-2-opt
        avg: -0.4%      min: -0.4%      max: -0.4%
piston-image-check
        avg: -0.4%      min: -0.4%      max: -0.4%
futures-opt
        avg: -0.4%      min: -0.4%      max: -0.4%
webrender-check
        avg: -0.4%      min: -0.4%      max: -0.4%
cranelift-codegen-check
        avg: -0.4%      min: -0.4%      max: -0.4%
ripgrep-check
        avg: -0.4%      min: -0.4%      max: -0.4%
regex-check
        avg: -0.4%      min: -0.4%      max: -0.4%
webrender-wrench-check
        avg: -0.4%      min: -0.4%      max: -0.4%
tokio-webpush-simple-check
        avg: -0.3%      min: -0.3%      max: -0.3%
syn-check
        avg: -0.3%      min: -0.3%      max: -0.3%
nnethercote

comment created time in 4 days

PR opened rust-lang/hashbrown

Avoid closures to improve compile times.

HashMap and HashSet are used widely, and often instantiated many times. As a result, small differences in how the code is written can have a significant effect on how much LLVM IR is generated, which affects compile times.

This commit avoids a lot of small closures by replacing calls to Option::map, Option::ok_or_else, Option::unwrap_or_else and Result::unwrap_or_elsewithmatch` expressions. Although this makes the code less concise, it improves compile times. For example, several of the benchmarks in rustc-perf compile up to 3.5% faster after this change is incorporated into std.

Every change is accompanied by a short comment to explain why a match is used. This may seem excessive, but without these comments it would be easy for a well-meaning person in the future to change some or all of these back to the original versions without understanding the consequences.

+139 -60

0 comment

3 changed files

pr created time in 4 days

create barnchnnethercote/hashbrown

branch : avoid-closures

created branch time in 4 days

Pull request review commentrust-lang/rust

Inlined symbols

 impl Symbol {     } } +// These `Symbol` methods are for accessing symbols via `SESSION_GLOBALS`.+impl Symbol {+    /// Map a string to its symbol representation, using the interner's table+    /// from `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn intern(string: &str) -> Self {+        if let Some(sym) = Symbol::try_new_inlined(string) {+            sym+        } else {+            with_interner(|interner| interner.intern(string))+        }+    }++    /// Access the symbol's chars, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn with<F: FnOnce(&str) -> R, R>(self, f: F) -> R {+        f(self.as_str().deref())+    }++    /// Convert to a `SymbolStr`, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn as_str(self) -> SymbolStr {

Unless I could remove the byte array and just make the &str point to the symbol's u32. It would work on little-endian machines, I'd have to think about what would be necessary for it to work on big-endian.

nnethercote

comment created time in 4 days

Pull request review commentrust-lang/rust

Inlined symbols

 impl Symbol {     } } +// These `Symbol` methods are for accessing symbols via `SESSION_GLOBALS`.+impl Symbol {+    /// Map a string to its symbol representation, using the interner's table+    /// from `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn intern(string: &str) -> Self {+        if let Some(sym) = Symbol::try_new_inlined(string) {+            sym+        } else {+            with_interner(|interner| interner.intern(string))+        }+    }++    /// Access the symbol's chars, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn with<F: FnOnce(&str) -> R, R>(self, f: F) -> R {+        f(self.as_str().deref())+    }++    /// Convert to a `SymbolStr`, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn as_str(self) -> SymbolStr {

I just tried this out, it's intriguing.

First, were you thinking that as_str() would become something like this?

    pub fn as_str(&self) -> &str {
        with_interner(|interner| unsafe {
            std::mem::transmute::<&str, &str>(interner.get(*self))
        })
    }

Instead of falsely claiming that the lifetime of the result is static, it falsely claims that the lifetime matches that of &self. So it's still a lie, but it's a much smaller lie. (Unless I've misunderstood something?)

I tried making this change without this PR's commits applied. It worked amazingly well. There are only about a dozen places where I need to use the old version, mostly where we are sorting vectors containing symbols, e.g.:

        names.sort_by_key(|n| n.as_str());

(I get borrowck errors with the new as_str() formulation.) The ToStableHashKey impl for Symbol is also tricky.

I can imagine with some effort it might be possible to eliminate SymbolStr entirely. Also, working with &str is nicer than SymbolStr, because it avoids the need for some & and &* occurrences.

Having said all that, won't this PR block this new approach? SymbolStr must exist with inline symbols -- because it contains the byte array in which we de-inline inlined symbols for as_str().

nnethercote

comment created time in 4 days

delete branch nnethercote/rust

delete branch : change-type-of-available_cgus

delete time in 4 days

push eventnnethercote/rust

Tim Diekmann

commit sha 076ef66ba2f647a627806f376c23b332fb04d3ff

Remove in-place allocation and revert to separate methods for zeroed allocations Fix docs

view details

Yuki Okushi

commit sha 788261d2d30c92c7423a68088aaee32ce44f9520

Add regression test for issue-59311

view details

Tim Diekmann

commit sha b01fbc437eae177cd02e7798f2f1454c1c6ed6e5

Simplify implementations of `AllocRef` for `Global` and `System`

view details

Eduard-Mihai Burtescu

commit sha 6bf3a4bcd836e4b29108bfb6d8d7b00d405fd03e

rustc_metadata: track the simplified Self type for every trait impl.

view details

Tim Diekmann

commit sha 9cd9286e20e6fe4cdb7e298fa5ec966eb26fa32b

Update doc-comment for grow_zeroed

view details

Tim Diekmann

commit sha db7d07b83bee302be977468caa6931f651b4f77a

Remove a trailing whitespace

view details

Stein Somers

commit sha 532e7f49fc6719528d37f69373aec821b09cd478

Separate off a leafy insert function instead of lying, and split split similarly

view details

Tim Diekmann

commit sha 24ddf76ed7bc453826e6e843cd0ca289e02185f1

Merge branch 'master' into remove-in-place-alloc

view details

Mateusz Mikuła

commit sha 594f81a2b4dae23827271ea3a4bbb21c1a0004e1

Make rust.use-lld config option work with non MSVC targets

view details

Tim Diekmann

commit sha 6395659168a760b31365e925dc5be5a201ac10ae

Apply suggestions from code review Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>

view details

bors

commit sha 80f84eb9c6eef2ee0b21988b03a09d0930575a60

Auto merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum Clarify reuse of a BTreeMap insert support function and treat split support likewise r? @Mark-Simulacrum

view details

Bastian Kauschke

commit sha 06dbd06e4deab2255d310d38ed0ea28becf43664

forbid `#[track_caller]` on main

view details

bors

commit sha 40857b9453a80801fc51b606b0d7532efedad42b

Auto merge of #75111 - mati865:use-lld-option, r=Mark-Simulacrum Make rust.use-lld config option work with non MSVC targets Builds fine and passes tests on Linux. Not overriding `use-lld` by `linker` makes sense on those platforms since very old GCC versions don't understand `-fuse-ld=lld`. This allows pointing to newer GCC or Clang that will know how to call LLD.

view details

Nicholas Nethercote

commit sha eeb4b83289e09956e0dda174047729ca87c709fe

Remove two fields from `SubstFolder`. They're only used in error messages printed if there's an internal compiler error, and the cost of maintaining them is high enough to show up in profiles.

view details

Yuki Okushi

commit sha cd7204ef394d1e53bb967086186e9b8664d7e268

Forbid non-derefable types explicitly in unsizing casts

view details

Pietro Albini

commit sha 268bc7fa2f8e09e371c6deb71eb9397700cb5342

ci: disable fail-fast on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fail-fast enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed.

view details

bors

commit sha c9b80bb3ff194d488fdd95da2ef23bd466f921cb

Auto merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed. r? @Mark-Simulacrum

view details

Ivan Tham

commit sha c577d71e03cebb03d079670e8b9ce995fb79560b

Remove log alias from librustdoc

view details

Guillaume Gomez

commit sha 0275cd74096b71f6c641b06e73e6cb359303d6cc

Clean up E0745

view details

bors

commit sha 5f6bd6ec0ac422991b89bb8643eaa5d9d46eed11

Auto merge of #74850 - TimDiekmann:remove-in-place-alloc, r=Amanieu Remove in-place allocation and revert to separate methods for zeroed allocations closes rust-lang/wg-allocators#58

view details

push time in 4 days

push eventnnethercote/hashbrown

Jon Gjengset

commit sha 284960cd74727d3277c4d3cde6510b8027c458cf

Do not iterate to drop if empty If the table is empty, there is no need to iterate over all the buckets in order to drop their contents. Fixes #170.

view details

bors

commit sha 7593ec95d097ace1e111b9a862f72a8db7eeddf2

Auto merge of #182 - jonhoo:fast-drop-empty, r=Amanieu Do not iterate to drop if empty If the table is empty, there is no need to iterate over all the buckets in order to drop their contents. Fixes #170.

view details

push time in 4 days

push eventnnethercote/rust

Tim Diekmann

commit sha 076ef66ba2f647a627806f376c23b332fb04d3ff

Remove in-place allocation and revert to separate methods for zeroed allocations Fix docs

view details

Yuki Okushi

commit sha 788261d2d30c92c7423a68088aaee32ce44f9520

Add regression test for issue-59311

view details

Tim Diekmann

commit sha b01fbc437eae177cd02e7798f2f1454c1c6ed6e5

Simplify implementations of `AllocRef` for `Global` and `System`

view details

Eduard-Mihai Burtescu

commit sha 6bf3a4bcd836e4b29108bfb6d8d7b00d405fd03e

rustc_metadata: track the simplified Self type for every trait impl.

view details

Tim Diekmann

commit sha 9cd9286e20e6fe4cdb7e298fa5ec966eb26fa32b

Update doc-comment for grow_zeroed

view details

Tim Diekmann

commit sha db7d07b83bee302be977468caa6931f651b4f77a

Remove a trailing whitespace

view details

Stein Somers

commit sha 532e7f49fc6719528d37f69373aec821b09cd478

Separate off a leafy insert function instead of lying, and split split similarly

view details

Tim Diekmann

commit sha 24ddf76ed7bc453826e6e843cd0ca289e02185f1

Merge branch 'master' into remove-in-place-alloc

view details

Mateusz Mikuła

commit sha 594f81a2b4dae23827271ea3a4bbb21c1a0004e1

Make rust.use-lld config option work with non MSVC targets

view details

Tim Diekmann

commit sha 6395659168a760b31365e925dc5be5a201ac10ae

Apply suggestions from code review Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>

view details

bors

commit sha 80f84eb9c6eef2ee0b21988b03a09d0930575a60

Auto merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum Clarify reuse of a BTreeMap insert support function and treat split support likewise r? @Mark-Simulacrum

view details

Bastian Kauschke

commit sha 06dbd06e4deab2255d310d38ed0ea28becf43664

forbid `#[track_caller]` on main

view details

bors

commit sha 40857b9453a80801fc51b606b0d7532efedad42b

Auto merge of #75111 - mati865:use-lld-option, r=Mark-Simulacrum Make rust.use-lld config option work with non MSVC targets Builds fine and passes tests on Linux. Not overriding `use-lld` by `linker` makes sense on those platforms since very old GCC versions don't understand `-fuse-ld=lld`. This allows pointing to newer GCC or Clang that will know how to call LLD.

view details

Nicholas Nethercote

commit sha eeb4b83289e09956e0dda174047729ca87c709fe

Remove two fields from `SubstFolder`. They're only used in error messages printed if there's an internal compiler error, and the cost of maintaining them is high enough to show up in profiles.

view details

Yuki Okushi

commit sha cd7204ef394d1e53bb967086186e9b8664d7e268

Forbid non-derefable types explicitly in unsizing casts

view details

Pietro Albini

commit sha 268bc7fa2f8e09e371c6deb71eb9397700cb5342

ci: disable fail-fast on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fail-fast enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed.

view details

bors

commit sha c9b80bb3ff194d488fdd95da2ef23bd466f921cb

Auto merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum ci: disable fast-fail on auto-fallible The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones. This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed. r? @Mark-Simulacrum

view details

Ivan Tham

commit sha c577d71e03cebb03d079670e8b9ce995fb79560b

Remove log alias from librustdoc

view details

Guillaume Gomez

commit sha 0275cd74096b71f6c641b06e73e6cb359303d6cc

Clean up E0745

view details

bors

commit sha 5f6bd6ec0ac422991b89bb8643eaa5d9d46eed11

Auto merge of #74850 - TimDiekmann:remove-in-place-alloc, r=Amanieu Remove in-place allocation and revert to separate methods for zeroed allocations closes rust-lang/wg-allocators#58

view details

push time in 4 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I have addressed all the comments and updated.

nnethercote

comment created time in 4 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_span = { path = "../librustc_span" } rustc_serialize = { path = "../librustc_serialize" }+rustc_session = { path = "../librustc_session" }

I have removed the dependency by passing in closures that capture the Session to two functions.

nnethercote

comment created time in 4 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha f9431516c15c4f7582747a17c64e2cfa69d1edbd

Eliminate the `SessionGlobals` from `librustc_ast`. By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`

view details

Nicholas Nethercote

commit sha adcba21e8179311ee7b32b274a2763087d5c118b

Eliminate `librustc_hir`'s dependency on `librustc_session`.

view details

push time in 4 days

issue commentrust-lang/rust

[NLL] Bad higher ranked subtype error

I hit this today working on the compiler, calling a function with this signature:

pub fn link_name<F>(check_name: F, attrs: &[ast::Attribute]) -> Option<Symbol>
where
    F: Fn(&ast::Attribute, Symbol) -> bool

I had no idea what "Bad higher ranked subtype error" meant, so I googled and found this issue, and concluded it was somehow related to lifetimes. After some experimentation I got this signature to work:

pub fn link_name<'a, F>(check_name: F, attrs: &'a [ast::Attribute]) -> Option<Symbol>
where
    F: Fn(&'a ast::Attribute, Symbol) -> bool

So it was a happy ending, but there was some wailing and gnashing of teeth along the way.

matthewjasper

comment created time in 4 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 use rustc_ast::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId}; use rustc_ast::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};-use rustc_ast::attr; use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};-use rustc_errors::{struct_span_err, Handler};+use rustc_errors::struct_span_err; use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};-use rustc_feature::{Features, GateIssue, UnstableFeatures};-use rustc_session::parse::{feature_err, feature_err_issue, ParseSess};+use rustc_feature::{Features, GateIssue};+use rustc_session::parse::{feature_err, feature_err_issue};+use rustc_session::Session; use rustc_span::source_map::Spanned; use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span;  use tracing::debug;  macro_rules! gate_feature_fn {-    ($cx: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr) => {{-        let (cx, has_feature, span, name, explain) = (&*$cx, $has_feature, $span, $name, $explain);-        let has_feature: bool = has_feature(&$cx.features);+    ($vis: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr) => {{

I will use $visitor.

nnethercote

comment created time in 4 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 use crate::ptr::P; use crate::token::{self, Token}; use crate::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint}; -use rustc_data_structures::sync::Lock; use rustc_index::bit_set::GrowableBitSet;-use rustc_span::edition::{Edition, DEFAULT_EDITION}; use rustc_span::source_map::{BytePos, Spanned}; use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::Span; -use log::debug; use std::iter; use std::ops::DerefMut; -// Per-session global variables: this struct is stored in thread-local storage-// in such a way that it is accessible without any kind of handle to all-// threads within the compilation session, but is not accessible outside the-// session.-pub struct SessionGlobals {-    used_attrs: Lock<GrowableBitSet<AttrId>>,-    known_attrs: Lock<GrowableBitSet<AttrId>>,-    span_session_globals: rustc_span::SessionGlobals,-}+pub struct MarkedAttrs(GrowableBitSet<AttrId>); -impl SessionGlobals {-    fn new(edition: Edition) -> SessionGlobals {-        SessionGlobals {-            // We have no idea how many attributes there will be, so just-            // initiate the vectors with 0 bits. We'll grow them as necessary.-            used_attrs: Lock::new(GrowableBitSet::new_empty()),-            known_attrs: Lock::new(GrowableBitSet::new_empty()),-            span_session_globals: rustc_span::SessionGlobals::new(edition),-        }+impl MarkedAttrs {+    // We have no idea how many attributes there will be, so just+    // initiate the vectors with 0 bits. We'll grow them as necessary.+    pub fn new() -> Self {

GrowableBitSet doesn't derive Default; it has a new_empty() method. And it's built on top of BitSet, which also doesn't derive Default, and has both new_empty() and new_filled() methods.

nnethercote

comment created time in 4 days

pull request commentrust-lang/rust

Inlined symbols

I have address @oli-obk's comments.

Reviewer responsiblity for this PR is unclear at this point. Officially its assigned to @petrochenkov, but @oli-obk has given feedback and @Mark-Simulacrum expressed interest above. I'm not picky about who does it, so long as it gets done :)

nnethercote

comment created time in 4 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha 2adb229260ca27c790afc253be3ff0cd86210d3f

Store short symbols in the `Symbol` itself.

view details

push time in 4 days

Pull request review commentrust-lang/rust

Inlined symbols

 impl Symbol {     } } +// These `Symbol` methods are for accessing symbols via `SESSION_GLOBALS`.+impl Symbol {+    /// Map a string to its symbol representation, using the interner's table+    /// from `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn intern(string: &str) -> Self {+        if let Some(sym) = Symbol::try_new_inlined(string) {+            sym+        } else {+            with_interner(|interner| interner.intern(string))+        }+    }++    /// Access the symbol's chars, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn with<F: FnOnce(&str) -> R, R>(self, f: F) -> R {+        f(self.as_str().deref())+    }++    /// Convert to a `SymbolStr`, using the interner's table from+    /// `SESSION_GLOBALS` if necessary (a relatively slow operation).+    pub fn as_str(self) -> SymbolStr {

Getting rid of SymbolStr would indeed be nice. I have written this idea down on my todo list.

nnethercote

comment created time in 4 days

Pull request review commentrust-lang/rust

Inlined symbols

 impl fmt::Display for MacroRulesNormalizedIdent {  /// An interned string. ///-/// Internally, a `Symbol` is implemented as an index, and all operations-/// (including hashing, equality, and ordering) operate on that index. The use-/// of `rustc_index::newtype_index!` means that `Option<Symbol>` only takes up 4 bytes,-/// because `rustc_index::newtype_index!` reserves the last 256 values for tagging purposes.+/// Internally, a `Symbol` is implemented as a u32, and all operations+/// (including hashing, equality, and ordering) operate on that u32. The use of+/// `rustc_index::newtype_index!` means that `Option<Symbol>` only takes up 4+/// bytes, because `rustc_index::newtype_index!` reserves the last 256 values+/// for tagging purposes.+///+/// Note that `Symbol` cannot directly be a `rustc_index::newtype_index!`+/// because it implements `fmt::Debug`, `Encodable`, and `Decodable` in special+/// ways.+///+/// For the interner in `SESSION_GLOBALS`, we use a two-part encoding. Strings+/// of length 4 or less (with some exceptions due to two encoding constraints+/// described below) are "inlined", i.e. stored within the u32 itself. Other+/// strings are "tabled", i.e. stored in the interner's table and the u32 is an+/// index. This helps performance because strings of length 4 are common+/// (roughly 50% of cases in practice) and those ones avoid the need to lock+/// and search the hash table.+///+/// The details of the encoding are as follows.+///+/// - The highest bit of the u32 is a tag bit.+///+/// - If the tag bit is 0, the symbol is inlined. The string bytes+///   (`s`) are encoded into the u32 (`u`) in a little-endian fashion:+///   - Byte 0 of `u` holds `s[0]`, or zero if `s.len()` is < 1.+///   - Byte 1 of `u` holds `s[1]`, or zero if `s.len()` is < 2.+///   - Byte 2 of `u` holds `s[2]`, or zero if `s.len()` is < 3.+///   - Byte 3 of `u` holds `s[3]`, or zero if `s.len()` is < 4. ///-/// Note that `Symbol` cannot directly be a `rustc_index::newtype_index!` because it-/// implements `fmt::Debug`, `Encodable`, and `Decodable` in special ways.+///   Some examples:+///   - ""     -> 0x00_00_00_00+///   - "a"    -> 0x00_00_00_61+///   - "ab"   -> 0x00_00_62_61+///   - "abc"  -> 0x00_63_62_61+///   - "abcd" -> 0x64_63_62_61+///+///   Because byte 3 contains the tag bit, for a string of length four to be+///   inlined its final byte must be < 0x80. For example, "cdé" can not be+///   inlined because in UTF-8 it is a four byte sequence `[0x64, 0x65, 0xc3,+///   0xa9]` and byte 3 is > 0x7f. (This is the first of the abovementioned+///   encoding constraints.)+///+///   The length of the string is not explicitly encoded. Rather, it is equal+///   to the index of the most-significant zero byte, or four if there are no+///   zero bytes. (For example, in 0x00_63_62_61 the most significant zero byte+///   is byte 3, and so the length is 3.) Because of this, a string whose final+///   char is a NUL char cannot be represented inline. For example, none of+///   "\0", "a\0", "ab\0", and "abc\0" can be inlined. (This is the second of+///   the abovementioned encoding constraints.)+///+/// - If the tag bit is 1, the symbol is tabled. The high bit must be removed+///   before being used as an index. For example, the fifth tabled symbol will+///   have the value 0x80_00_00_05.+///+///   The maximum value of a `newtype_index` is 0xff_ff_ff_00, due to highest+///   256 values being reserved. Therefore, the maximum index representable is+///   0x7f_ff_ff_00 (2,147,483,392). Given that the maximum number of bytes in+///   a crate is 0xff_ff_ff_ff, this should be more than enough for tabled+///   symbols.+///+/// For interners other than the one in `SESSION_GLOBALS` (which are rare and+/// not that performance-critical) all symbols are interned, i.e. the u32 is an+/// index into the interner's table with its high bit set. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Symbol(SymbolIndex);  rustc_index::newtype_index! {     pub struct SymbolIndex { .. } } +// These `Symbol` methods are simple methods that work with just the `Symbol`+// itself, and do not involve `SESSION_GLOBALS`. impl Symbol {-    const fn new(n: u32) -> Self {-        Symbol(SymbolIndex::from_u32(n))+    /// Try to create an inlined symbol from a string.+    /// WARNING: this function must behave equivalently to `is_inlinable()` in

I tried to make this clear by the use of "equivalently" and the comment on is_inlinable(), but I guess I failed. I will try to clarify the comment further.

nnethercote

comment created time in 4 days

pull request commentrust-lang/rust

Change the type of `AssertModuleSource::available_cgus`.

I have changed it to a BTreeSet<String>.

nnethercote

comment created time in 4 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha ebbf07a1544151867e20ff75f740836aba1ff73a

Change the type of `AssertModuleSource::available_cgus`. It's currently a `BTreeSet<Symbol>`, which is a strange type. The `BTreeSet` suggests that element order is important, but `Symbol` is a type whose ordering isn't useful to humans. The ordering of the collection only manifests in an obscure error message ("no module named `...`") that doesn't appear in any tests. This commit changes the `Symbol` to a `String`, which is more typical.

view details

push time in 4 days

issue commentrust-lang/rustc-perf

multi-factor UI performance improvements

I prefer M and G to e6 notation.

leeoniya

comment created time in 4 days

push eventnnethercote/cargo-llvm-lines

panstromek

commit sha 732a77a16d0396080655f2c2465041c2f9ba9ac5

Don't return when run_cargo_rustc fails and try to read the llvm-ir anyway.

view details

David Tolnay

commit sha 0d2a3bab05731105ab7a5f76dd5e3a1dcc206d12

Merge pull request #23 from panstromek/fix-windows "Fix" the tool not working on Windows

view details

David Tolnay

commit sha d1e1eafdd4b00bc6772727f14437c583d84ffbbd

Apply windows-specific workaround to windows only

view details

David Tolnay

commit sha a7bb671d2d8c2cbf6e8ab441daeaf88fc6679cf5

Merge pull request #24 from dtolnay/hack Apply windows-specific workaround to windows only

view details

David Tolnay

commit sha a3ecf53839be752ff567b95a012a43f0441d0fa4

Release 0.4.2

view details

David Tolnay

commit sha 386956acfee551753b98d866432247d46314157f

New style of readme badges

view details

David Tolnay

commit sha bbd70d13c44d5e28f629d49987230340e8a1fb09

Add crosslink icons to top of rustdoc

view details

David Tolnay

commit sha 108455ad54614ba871e6114d6c730a66d1492893

Release 0.4.3

view details

David Tolnay

commit sha 56858321dd44ac95bc6585e87761664a3b647468

Replace use of blacklist as variable name

view details

David Tolnay

commit sha a50e33d23eaf7942f1869c445301138b7629da21

Inline pipe_to body

view details

David Tolnay

commit sha d5a3a049fd2d6a932e7b80754c9b12db45ab3727

Inline run body

view details

David Tolnay

commit sha 803f6681e04bd41901d7542209ea09265bc0ad34

Remove unused status code computation

view details

David Tolnay

commit sha 868a3c2030a39521fec6e659ffcf32e831fdec87

Remove pipe to cat

view details

David Tolnay

commit sha 77531d7330984417fba89bf946b5e736d20d803c

Inline Wait's drop behavior

view details

David Tolnay

commit sha 8a66f9a794eeac22da6f34f5d58c7373574c16be

Simplify child process waiting

view details

David Tolnay

commit sha 9debf4540ae5e8af1c9f5b9c40990681dee221c4

Move errcmd explanation where it makes more sense

view details

David Tolnay

commit sha 7d483963b2b7ab93cc2ecd8eb78fd8f0e4e61eae

Regroup run_cargo_rustc contents

view details

David Tolnay

commit sha 90a24ca2f03daf8380bd5d2c97c19e6b14b6356a

Remove windows kludge The error in the comment was fixed by no longer invoking `cat`.

view details

David Tolnay

commit sha 01ada0e8be294fc9592c261dcd8f250cc29fd24f

Check cargo rustc exit code

view details

David Tolnay

commit sha 50cb5ea8804f774412e3116cfb7659e080fd998c

Merge pull request #27 from dtolnay/spawn Eliminate pipe to cat

view details

push time in 5 days

issue commentrust-lang/rustc-perf

multi-factor UI performance improvements

what's the proper rust-land term for doc, opt, debug, check?

These are buildKinds.

Highcharts appears to use G for denoting tick labels for billions but i'm leaning towards using B, unless there's some logic behind this?

Either you want the abbreviation for the SI prefix (K for kilo, M for mega, G for giga) or the abbrevation for the number name (T for thousand(?), M for million, B for Billion). In practice all our numbers are millions or billions, so it probably doesn't matter much either way.

also, what are the pink diamond datapoints in the Summary charts?

They mean "something went wrong". E.g. when looking at the chart for a single benchmark, it failed to measure somehow, e.g. because of a compile error. For script-servo-2 there are currently "failures" because that benchmark was removed. And for the summary graphs, pink diamonds will show up if there's a failure in any of the individual benchmarks.

If you have valid results followed by some failures followed by more valid results, the system does its best to interpolate pink diamonds across the stretch of no results.

leeoniya

comment created time in 5 days

PR opened rust-lang/rust

Change the type of `AssertModuleSource::available_cgus`.

It's currently a BTreeSet<Symbol>, which is a strange type. The BTreeSet suggests that element order is important, but Symbol is a type whose ordering isn't useful to humans. The ordering of the collection only manifests in an obscure error message ("no module named ...") that doesn't appear in any tests.

This commit changes the BTreeSet to an FxHashSet, which is more typical.

+4 -5

0 comment

1 changed file

pr created time in 5 days

create barnchnnethercote/rust

branch : change-type-of-available_cgus

created branch time in 5 days

pull request commentrust-lang/rust

Inlined symbols

@bors try @rust-timer queue

nnethercote

comment created time in 5 days

pull request commentrust-lang/rust

Inlined symbols

I have cleaned up the code, it's ready for review.

@crlf0710 The first two commits involve the confusable idents checking, you might be interested.

nnethercote

comment created time in 5 days

push eventnnethercote/rust

Caio

commit sha 187aea7c34adf06b0db39f688d60d3fdac8e7e3e

Impl Default for ranges

view details

flip1995

commit sha f7acea2683c6124854bfe20e7127e4dfba344d3e

Register redundant_field_names and non_expressive_names as early passes

view details

flip1995

commit sha 485229c4a3d6a2fbe40f5a6976a33144a27497c6

Fix fallout in redundant_field_names

view details

flip1995

commit sha efd3dcff97f67f376e354c047133ce9044c52991

Fix fallout in similar_names

view details

Eduardo Broto

commit sha bb37a0f948b02e6434dbe3ea615960052d37f784

Avoid triggering similar names on code from expansion

view details

Alexis Bourget

commit sha 2853448426ce76926baa7e6e6173c15228e4951a

Document the ref keyword

view details

Stefan Lankes

commit sha 6813c1c69baf870a479c70e23ad0550d1d9aa9be

revise RwLock, which is derived from the wasm implementation - increasing the readability of `Condvar` - simplify the interface to the libos HermitCore

view details

Stefan Lankes

commit sha 3acc3ef10d2099a4b3118e8c705b36f4bbaf6f64

minor changes to pass the format check

view details

Stefan Lankes

commit sha beb1b1fa5b1047c7caf8a1d499725df3c1ad8cad

reorder crates to pass the format check

view details

Stefan Lankes

commit sha f9c609164251abc136eb9bda55c92cb99adb5c86

remove some compiler warnings

view details

Trevor Spiteri

commit sha 6dfe144bdd4413ac55cbb2ad2edfb1daa0c4bf15

stabilize const_nonzero_int_methods

view details

Trevor Spiteri

commit sha 9739b512a892628534e730ffcd9756b3218c8de8

stabilize some const_checked_int_methods

view details

Trevor Spiteri

commit sha c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799

stabilize const_saturating_int_methods

view details

Trevor Spiteri

commit sha 056d925167318636fcf975c8ffb81efebdc9bca3

stabilize const_int_sign

view details

Trevor Spiteri

commit sha 2a84e313df095fd0e81b9348b68bd9b1d1caa551

stabilize const_ascii_ctype_on_intrinsics

view details

Adam Perry

commit sha d275739c09f266479d6db388cbf55ba6ca791b9d

Derive common traits for panic::Location. Add documentation about the host/target behavior of Location::file.

view details

Jamie Cunliffe

commit sha fc52b47e8013da325fc0a0f5d3897143243ba206

va_args implementation for AAPCS. Implement the va args in codegen for AAPCS, this will be used as the default va_args implementation for AArch64 rather than the va_args llvm-ir as it currently is. Copyright (c) 2020, Arm Limited.

view details

Alexis Bourget

commit sha 837a761b398a6ff6a97f7f61e390dae9efbeab79

Document the where keyword

view details

Andrey Zgarbul

commit sha 7d4a92d4f8dc03409984695d78893fffdd3ff1f9

remove LengthAtMost32 on AsRef/Borrow impl for array

view details

Roman Proskuryakov

commit sha eff62069ad602090e8d27b83cffd9e77479ed4be

Remove the usage of the LengthAtMost32 trait

view details

push time in 5 days

delete branch nnethercote/rust

delete branch : clean-up-rustdoc-main

delete time in 5 days

pull request commentrust-lang/rust

manually implement traits for Span

Probably better to drop it, because it introduces additional complexity.

lcnr

comment created time in 6 days

pull request commentrust-lang/rust

Clean up rustdoc's `main()`

I have addressed all the comments.

nnethercote

comment created time in 6 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha 530140729a458462f5c6e735e771651ce419a0a3

Avoid an unnecessary thread creation at rustdoc startup. rustdoc's `main()` immediately spawns a thread, M, with a large stack (16MiB or 32MiB) on which it runs `main_args()`. `main_args()` does a small amount of options processing and then calls `setup_callbacks_and_run_in_default_thread_pool_with_globals()`, which spawns it own thread, and M is not used further. So, thread M seems unnecessary. However, it does serve a purpose: if the options processing in `main_args()` panics, that panic is caught when M is joined. So M can't simply be removed. However, `main_options()`, which is called by `main_args()`, has a `catch_fatal_errors()` call within it. We can move that call to `main()` and change it to the very similar `catch_with_exit_code()`. With that in place, M can be removed, and panics from options processing will still be caught appropriately. Even better, this makes rustdoc's `main()` match rustc's `main()`, which also uses `catch_with_exit_code()`. (Also note that the use of a 16MiB/32MiB stack was eliminated from rustc in #55617.)

view details

Nicholas Nethercote

commit sha af4e3e08ea3d9739e5af541b737527584cea1d8f

Remove `setup_callbacks_and_run_in_default_thread_pool_with_globals()`. It's a very thin wrapper around `setup_callbacks_and_run_in_thread_pool_with_globals()` and it has a single call site.

view details

Nicholas Nethercote

commit sha 5f8a11279d75dc0078edbd8fa9d1fd1184c3f4ec

Be smarter about error handling in `run()`. `run()` returns `Result<(), String>`. But on failure it always returns an empty string, and then `wrap_return()` treats an empty string specially, by not reporting the error. It turns out we already have the `ErrorReported` type for this sort of behaviour. This commit changes `run()` to use it.

view details

push time in 6 days

Pull request review commentrust-lang/rust

Clean up rustdoc's `main()`

 fn main_args(args: &[String]) -> i32 {             early_error(ErrorOutputType::default(), &err.to_string());         }     };++    // Note that we discard any distinction between different non-zero exit+    // codes from `from_matches` here.     let options = match config::Options::from_matches(&matches) {         Ok(opts) => opts,-        Err(code) => return code,+        Err(code) => return if code == 0 { Ok(()) } else { Err(()) },     };-    rustc_interface::interface::setup_callbacks_and_run_in_default_thread_pool_with_globals(+    rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals(         options.edition,+        1, // this runs single-threaded, even in a parallel compiler+        &None,         move || main_options(options),     ) } -fn wrap_return(diag: &rustc_errors::Handler, res: Result<(), String>) -> i32 {+fn wrap_return(diag: &rustc_errors::Handler, res: Result<(), String>) -> Result<(), ()> {     match res {-        Ok(()) => 0,+        Ok(()) => Ok(()),         Err(err) => {             if !err.is_empty() {

Using ErrorReported is the proper way to do this. I have added a commit that does so.

nnethercote

comment created time in 6 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I have updated. Most of the changes outside of rustc are now no longer necessary, but the changes within rustc are still there. So it's still a big change.

nnethercote

comment created time in 6 days

push eventnnethercote/rust

Aaron Hill

commit sha ac9dfc3e7785c9bba96ebac4fd51726189e1bf91

Normalize opaque types when converting `ParamEnv` to `Reveal::All` Fixes #65918

view details

Aaron Hill

commit sha 117a60e1f5045e317d3f76ce60be28d18c694608

Erase regions in try_eval_bits

view details

Aaron Hill

commit sha 90aee14eb95ac0b9ddb7cf5db6d003155e94800c

Skip computing param_env and size if not needed

view details

Aaron Hill

commit sha 5e2e927e0107916b825b164c82be44877ac6ab54

Fix rebase fallout

view details

Pietro Albini

commit sha cb76f821942053091706b7bb2c4dc416bb09bfb9

ci: avoid symlinking the build directory on self-hosted builders

view details

Pietro Albini

commit sha fe5a40eb14f233554a30c038cf8944b2d2adf9ff

ci: add aarch64-gnu as a fallible auto builder

view details

Guillaume Gomez

commit sha 403164569170e3f5c06db8b66257ac61db7cff4b

Clean up E0728 explanation

view details

Guillaume Gomez

commit sha 1d2e3fff69b654c3dfd6a810e193db29bb1868fa

Clean up E0730 explanation

view details

Andy Russell

commit sha 0b320086425937b17bda5ee9e856ac6441d71d96

report kind of deprecated item in message This is important for fields, which are incorrectly referred to as "items".

view details

Guillaume Gomez

commit sha f22a34e84d4dba9b17bb3e68051ee82bd85f3c94

Clean up E0734 explanation

view details

Alan Somers

commit sha 013e1a6e9f73125734cb919d9b6220b3a4710d67

Enable the profiler on FreeBSD FreeBSD has been doing this in our own package builds for two months now. https://svnweb.freebsd.org/ports?view=revision&revision=535771

view details

Nathaniel McCallum

commit sha 25670749b44a9c7a4cfd3fbf780bbe3344a9a6c5

Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408

view details

Michal 'vorner' Vaner

commit sha ad6d63ef01e37a1a05acdba50985b01d178d7c11

Don't use "weak count" around Weak::from_raw_ptr As `Rc/Arc::weak_count` returns 0 when having no strong counts, this could be confusing and it's better to avoid using that completely. Closes #73840.

view details

David Sonder

commit sha b5d143b126cd73c873fc8feff7dee0a0b077cc84

Enable docs on dist-x86_64-musl Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

view details

Stein Somers

commit sha c4f4639e1a2eb07d17e7393a1c7f0594f0c11faf

Remove into_slices and its unsafe block

view details

Oliver Scherer

commit sha 5e96bb459377896a85be4a192e16feca4c1d4aaf

Replace all uses of `log::log_enabled` with `Debug` printers

view details

Alexis Bourget

commit sha 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5

Clarify the doc for MaybeUninit::zeroed on incorrect use

view details

Oliver Scherer

commit sha 7d67a1b871c41fb498eeffcadfa33f1fa4c35774

Replace write-to-vec hack by introducing a display renderer for allocations

view details

Alex Crichton

commit sha 2c1b0467e02a763a61335b8acb3c29524bcb9e6d

rustc: Improving safe wasm float->int casts This commit improves code generation for WebAssembly targets when translating floating to integer casts. This improvement is only relevant when the `nontrapping-fptoint` feature is not enabled, but the feature is not enabled by default right now. Additionally this improvement only affects safe casts since unchecked casts were improved in #74659. Some more background for this issue is present on #73591, but the general gist of the issue is that in LLVM the `fptosi` and `fptoui` instructions are defined to return an `undef` value if they execute on out-of-bounds values; they notably do not trap. To implement these instructions for WebAssembly the LLVM backend must therefore generate quite a few instructions before executing `i32.trunc_f32_s` (for example) because this WebAssembly instruction traps on out-of-bounds values. This codegen into wasm instructions happens very late in the code generator, so what ends up happening is that rustc inserts its own codegen to implement Rust's saturating semantics, and then LLVM also inserts its own codegen to make sure that the `fptosi` instruction doesn't trap. Overall this means that a function like this: #[no_mangle] pub unsafe extern "C" fn cast(x: f64) -> u32 { x as u32 } will generate this WebAssembly today: (func $cast (type 0) (param f64) (result i32) (local i32 i32) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.gt local.set 1 block ;; label = @1 block ;; label = @2 local.get 0 f64.const 0x0p+0 (;=0;) local.get 0 f64.const 0x0p+0 (;=0;) f64.gt select local.tee 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@2;) local.get 0 i32.trunc_f64_u local.set 2 br 1 (;@1;) end i32.const 0 local.set 2 end i32.const -1 local.get 2 local.get 1 select) This PR improves the situation by updating the code generation for float-to-int conversions in rustc, specifically only for WebAssembly targets and only for some situations (float-to-u8 still has not great codegen). The fix here is to use basic blocks and control flow to avoid speculatively executing `fptosi`, and instead LLVM's raw intrinsic for the WebAssembly instruction is used instead. This effectively extends the support added in #74659 to checked casts. After this commit the codegen for the above Rust function looks like: (func $cast (type 0) (param f64) (result i32) (local i32) block ;; label = @1 local.get 0 f64.const 0x0p+0 (;=0;) f64.ge local.tee 1 i32.const 1 i32.xor br_if 0 (;@1;) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.le i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const -1 i32.const 0 local.get 1 select) For reference, in Rust 1.44, which did not have saturating float-to-integer casts, the codegen LLVM would emit is: (func $cast (type 0) (param f64) (result i32) block ;; label = @1 local.get 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const 0) So we're relatively close to the original codegen, although it's slightly different because the semantics of the function changed where we're emulating the `i32.trunc_sat_f32_s` instruction rather than always replacing out-of-bounds values with zero. There is still work that could be done to improve casts such as `f32` to `u8`. That form of cast still uses the `fptosi` instruction which generates lots of branch-y code. This seems less important to tackle now though. In the meantime this should take care of most use cases of floating-point conversion and as a result I'm going to speculate that this... Closes #73591

view details

Erik Desjardins

commit sha c596e01b8ea34bb46444005425cd5aa825515f7b

add track_caller to RefCell::{borrow, borrow_mut} So panic messages point at the offending borrow.

view details

push time in 6 days

pull request commentrust-lang/rust

manually implement traits for Span

@bors try @rust-timer queue

lcnr

comment created time in 6 days

issue commentrust-lang/rustc-perf

Re-enable local std?

Any progress here?

Mark-Simulacrum

comment created time in 6 days

pull request commentrust-lang/rustc-perf

Drop script-servo-2 benchmark

It's a shame to lose this benchmark, but the cost/benefit ratio just isn't favourable. I almost always skip it when doing local runs.

Also, the total duration of the perf suite is a real problem, because CI perf runs have been struggling to keep up with merges since the switch to GitHub Actions reduced the time per merge down to about 2 hours. Removing this benchmark is the simplest and most effective step for reducing the duration.

r=me

Mark-Simulacrum

comment created time in 6 days

delete branch nnethercote/rust

delete branch : rm-SubstFolder-fields

delete time in 6 days

pull request commentrust-lang/rust

manually implement traits for Span

There are some nice ideas here! I like the optimized PartialEq and the space optimization for Option<Span>.

The StructuralEq and repr(transparent) changes are something of a mystery to me. I looked up what they mean, but I still don't understand their benefit for Span.

I have a preference for commit messages that have a full sentence on their first line, and I don't like commits that fix up things that could easily have been fixed in earlier commits (e.g. the "words" commit) so I'd be happy to see some clean-ups there.

Finally, whether all this is worth it will depend on the perf results, so I will wait for them before giving r+. Do you have any local measurements?

lcnr

comment created time in 6 days

Pull request review commentrust-lang/rust

manually implement traits for Span

 impl PartialEq for Span {     } } +impl StructuralPartialEq for Span {}

Please add a comment explaining why this is present.

lcnr

comment created time in 6 days

Pull request review commentrust-lang/rust

manually implement traits for Span

 pub struct Span { }  rustc_index::newtype_index! {+    #[repr(transparent)]

Please add a comment explaining why this is present.

lcnr

comment created time in 6 days

Pull request review commentrust-lang/rust

manually implement traits for Span

 use std::marker::{StructuralEq, StructuralPartialEq}; #[derive(Clone, Copy)] #[repr(C)] // So we can transmute to a `u64`. pub struct Span {-    base_or_index: u32,+    // We can transmute `SpanBaseOrIndex` to an `u32` as it is internally+    // represented as a scalar value.+    base_or_index: SpanBaseOrIndex,     len_or_tag: u16,     ctxt_or_zero: u16, } +rustc_index::newtype_index! {+    pub struct SpanBaseOrIndex {+        const DUMMY_SPAN_INDEX = 0,+    }+}++#[cfg(target_arch = "x86_64")]

This is worth a comment. E.g. "SpanBaseOrIndex is implemented via newtype_index, which means that Option<Span> takes the same space as Span.

lcnr

comment created time in 6 days

Pull request review commentrust-lang/rust

manually implement traits for Span

 use std::marker::{StructuralEq, StructuralPartialEq}; #[derive(Clone, Copy)] #[repr(C)] // So we can transmute to a `u64`. pub struct Span {-    base_or_index: u32,+    // We can transmute `SpanBaseOrIndex` to an `u32` as it is internally

Nit: "a u32"

lcnr

comment created time in 6 days

PR closed rust-lang/rust

Tweak `RawVec::reserve{,_exact}`.

r? @ghost

+16 -8

8 comments

1 changed file

nnethercote

pr closed time in 7 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha eeb4b83289e09956e0dda174047729ca87c709fe

Remove two fields from `SubstFolder`. They're only used in error messages printed if there's an internal compiler error, and the cost of maintaining them is high enough to show up in profiles.

view details

push time in 7 days

pull request commentrust-lang/rust

Remove two fields from `SubstFolder`.

Did you mean to r? matthewjasper perhaps?

GitHub suggested you as a reviewer, but it sounds like that wasn't a good suggestion.

r? @matthewjasper

nnethercote

comment created time in 7 days

pull request commentrust-lang/rust

Remove two fields from `SubstFolder`.

Some local measurements:

wf-projection-stress-65510-che...
        avg: -1.6%      min: -2.5%      max: -0.0%
ctfe-stress-4-check
        avg: -0.3%?     min: -0.5%?     max: -0.0%?
packed-simd-check
        avg: -0.2%      min: -0.3%      max: -0.0%
regression-31157-check
        avg: -0.1%      min: -0.3%      max: -0.0%
futures-check
        avg: -0.1%      min: -0.3%      max: -0.0%
wg-grammar-check
        avg: -0.2%      min: -0.2%      max: -0.0%
piston-image-check
        avg: -0.1%      min: -0.2%      max: -0.0%
ripgrep-check
        avg: -0.1%      min: -0.2%      max: 0.0%
serde-check
        avg: -0.1%      min: -0.2%      max: -0.0%
hyper-2-check
        avg: -0.1%      min: -0.2%      max: -0.0%
cargo-check
        avg: -0.1%      min: -0.2%      max: -0.0%

@bors try @rust-timer queue

nnethercote

comment created time in 7 days

PR opened rust-lang/rust

Remove two fields from `SubstFolder`.

They're only used in error messages printed if there's an internal compiler error, and the cost of maintaining them is high enough to show up in profiles.

r? @matthiaskrgr

+6 -30

0 comment

1 changed file

pr created time in 7 days

create barnchnnethercote/rust

branch : rm-SubstFolder-fields

created branch time in 7 days

push eventnnethercote/rust

Alex Crichton

commit sha 2c1b0467e02a763a61335b8acb3c29524bcb9e6d

rustc: Improving safe wasm float->int casts This commit improves code generation for WebAssembly targets when translating floating to integer casts. This improvement is only relevant when the `nontrapping-fptoint` feature is not enabled, but the feature is not enabled by default right now. Additionally this improvement only affects safe casts since unchecked casts were improved in #74659. Some more background for this issue is present on #73591, but the general gist of the issue is that in LLVM the `fptosi` and `fptoui` instructions are defined to return an `undef` value if they execute on out-of-bounds values; they notably do not trap. To implement these instructions for WebAssembly the LLVM backend must therefore generate quite a few instructions before executing `i32.trunc_f32_s` (for example) because this WebAssembly instruction traps on out-of-bounds values. This codegen into wasm instructions happens very late in the code generator, so what ends up happening is that rustc inserts its own codegen to implement Rust's saturating semantics, and then LLVM also inserts its own codegen to make sure that the `fptosi` instruction doesn't trap. Overall this means that a function like this: #[no_mangle] pub unsafe extern "C" fn cast(x: f64) -> u32 { x as u32 } will generate this WebAssembly today: (func $cast (type 0) (param f64) (result i32) (local i32 i32) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.gt local.set 1 block ;; label = @1 block ;; label = @2 local.get 0 f64.const 0x0p+0 (;=0;) local.get 0 f64.const 0x0p+0 (;=0;) f64.gt select local.tee 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@2;) local.get 0 i32.trunc_f64_u local.set 2 br 1 (;@1;) end i32.const 0 local.set 2 end i32.const -1 local.get 2 local.get 1 select) This PR improves the situation by updating the code generation for float-to-int conversions in rustc, specifically only for WebAssembly targets and only for some situations (float-to-u8 still has not great codegen). The fix here is to use basic blocks and control flow to avoid speculatively executing `fptosi`, and instead LLVM's raw intrinsic for the WebAssembly instruction is used instead. This effectively extends the support added in #74659 to checked casts. After this commit the codegen for the above Rust function looks like: (func $cast (type 0) (param f64) (result i32) (local i32) block ;; label = @1 local.get 0 f64.const 0x0p+0 (;=0;) f64.ge local.tee 1 i32.const 1 i32.xor br_if 0 (;@1;) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.le i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const -1 i32.const 0 local.get 1 select) For reference, in Rust 1.44, which did not have saturating float-to-integer casts, the codegen LLVM would emit is: (func $cast (type 0) (param f64) (result i32) block ;; label = @1 local.get 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const 0) So we're relatively close to the original codegen, although it's slightly different because the semantics of the function changed where we're emulating the `i32.trunc_sat_f32_s` instruction rather than always replacing out-of-bounds values with zero. There is still work that could be done to improve casts such as `f32` to `u8`. That form of cast still uses the `fptosi` instruction which generates lots of branch-y code. This seems less important to tackle now though. In the meantime this should take care of most use cases of floating-point conversion and as a result I'm going to speculate that this... Closes #73591

view details

carbotaniuman

commit sha 784dd22aac3f58eebc73ff54ae0ea43682392e68

add `unsigned_abs` to signed integers

view details

Lukas Wirth

commit sha 35d6a2ef2ba71d5ea120c2879825968babcf9a89

Lint path statements to use drop for drop types

view details

Joshua Nelson

commit sha e97e6fbe343d0afac795e6c13201ce31047dc219

Fix logging for rustdoc

view details

Yuki Okushi

commit sha 2e5c50195aa0345e174ff9970ec58b7e154c0132

Do not trigger `unused_braces` for `while let`

view details

David Sonder

commit sha f130e18c01a0108af23710418d8fb9eddb7647e1

Enable docs on in the x86_64-unknown-linux-musl manifest Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs. Generating and uploading the docs was enabled in b5d143b.

view details

Mark Rousskov

commit sha d2fc809fdb2e92581a0ecd70dec3e179dbd3439a

Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build.

view details

Aaron Hill

commit sha 6deda6a6a05e6e6ace8fb015d610c6355efb0fd7

Stabilize Ident::new_raw Tracking issue: #54723 This is a continuation of PR #59002

view details

Vadim Petrochenkov

commit sha 0a88346be64d0c64771d72ada8583e5795416556

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc

view details

Vadim Petrochenkov

commit sha 05f414b72a26b285c7a7f6c9632945ab567a9757

rustc_ast: More detailed docs for `Attribute::check_name`

view details

bors

commit sha 1d601d6ff1879a20a25dda06b735cd44cd451f61

Auto merge of #74695 - alexcrichton:more-wasm-float-cast-fixes, r=nagisa rustc: Improving safe wasm float->int casts This commit improves code generation for WebAssembly targets when translating floating to integer casts. This improvement is only relevant when the `nontrapping-fptoint` feature is not enabled, but the feature is not enabled by default right now. Additionally this improvement only affects safe casts since unchecked casts were improved in #74659. Some more background for this issue is present on #73591, but the general gist of the issue is that in LLVM the `fptosi` and `fptoui` instructions are defined to return an `undef` value if they execute on out-of-bounds values; they notably do not trap. To implement these instructions for WebAssembly the LLVM backend must therefore generate quite a few instructions before executing `i32.trunc_f32_s` (for example) because this WebAssembly instruction traps on out-of-bounds values. This codegen into wasm instructions happens very late in the code generator, so what ends up happening is that rustc inserts its own codegen to implement Rust's saturating semantics, and then LLVM also inserts its own codegen to make sure that the `fptosi` instruction doesn't trap. Overall this means that a function like this: #[no_mangle] pub unsafe extern "C" fn cast(x: f64) -> u32 { x as u32 } will generate this WebAssembly today: (func $cast (type 0) (param f64) (result i32) (local i32 i32) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.gt local.set 1 block ;; label = @1 block ;; label = @2 local.get 0 f64.const 0x0p+0 (;=0;) local.get 0 f64.const 0x0p+0 (;=0;) f64.gt select local.tee 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@2;) local.get 0 i32.trunc_f64_u local.set 2 br 1 (;@1;) end i32.const 0 local.set 2 end i32.const -1 local.get 2 local.get 1 select) This PR improves the situation by updating the code generation for float-to-int conversions in rustc, specifically only for WebAssembly targets and only for some situations (float-to-u8 still has not great codegen). The fix here is to use basic blocks and control flow to avoid speculatively executing `fptosi`, and instead LLVM's raw intrinsic for the WebAssembly instruction is used instead. This effectively extends the support added in #74659 to checked casts. After this commit the codegen for the above Rust function looks like: (func $cast (type 0) (param f64) (result i32) (local i32) block ;; label = @1 local.get 0 f64.const 0x0p+0 (;=0;) f64.ge local.tee 1 i32.const 1 i32.xor br_if 0 (;@1;) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.le i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const -1 i32.const 0 local.get 1 select) For reference, in Rust 1.44, which did not have saturating float-to-integer casts, the codegen LLVM would emit is: (func $cast (type 0) (param f64) (result i32) block ;; label = @1 local.get 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const 0) So we're relatively close to the original codegen, although it's slightly different because the semantics of the function changed where we're emulating the `i32.trunc_sat_f32_s` instruction rather than always replacing out-of-bounds values with zero. There is still work that could be done to improve casts such as `f32` to `u8`. That form of cast still uses the `fptosi` instruction which generates lots of branch-y code. This seems less important to tackle now though. In the meantime this should take care of most use cases of floating-point conversion and as a result I'm going to speculate that this... Closes #73591

view details

Yuki Okushi

commit sha cc0ac7eecebd57278974329d3610bb2512740ef8

Rollup merge of #74759 - carbotaniuman:uabs, r=shepmaster add `unsigned_abs` to signed integers Mentioned on rust-lang/rfcs#2914 This PR simply adds an `unsigned_abs` to signed integers function which returns the correct absolute value as a unsigned integer.

view details

Yuki Okushi

commit sha 262fce481dc60c348ba0436caabd4a824ecc412e

Rollup merge of #75043 - petrochenkov:hasname, r=nnethercote rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc, only rustc needs to mark attributes as used. cc https://github.com/rust-lang/rust/pull/74932 r? @nnethercote

view details

Yuki Okushi

commit sha 485bfa7a7581e05f08a42bef3878a392c461ddc5

Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.

view details

Yuki Okushi

commit sha c2bc733d99b99a830239c553759ce7b59ffbc507

Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum Fix logging for rustdoc https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557

view details

Yuki Okushi

commit sha 4eb9253660d384cfdb73c166285bd4b3dab3f0d7

Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for #75031 r? @lcnr

view details

Yuki Okushi

commit sha 622759d129e7acad53cf4d54415254db7018568c

Rollup merge of #75084 - Aaron1011:stabilize/ident-new-raw, r=petrochenkov Stabilize Ident::new_raw Tracking issue: #54723 This is a continuation of PR #59002

view details

Yuki Okushi

commit sha 40adcabb77d24143bb48d5541957794e4157c089

Rollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad Disable building rust-analyzer on riscv64 riscv64 has an LLVM bug that makes rust-analyzer not build. Should permit future rust-analyzer ups (e.g., https://github.com/rust-lang/rust/pull/74813) to land.

view details

Yuki Okushi

commit sha aa84a76150edaf4e912fca445d54a32f2d682d9d

Rollup merge of #75106 - etherealist:docs_manifest, r=Mark-Simulacrum Enable docs on in the x86_64-unknown-linux-musl manifest Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs. Generating and uploading the docs was enabled in b5d143b (#74871). In #75102 @Mark-Simulacrum found that we are uploading the docs, but the correct manifest is missing. * The relevant call to build-manifest seems to be [in bootstrap](https://github.com/rust-lang/rust/blob/c058a8b8dc5dea0ed9b33e14da9e317e2749fcd7/src/bootstrap/dist.rs#L2334) * The manifest is then used in [promote-release crontab](https://github.com/rust-lang/rust-central-station/blob/master/crontab)

view details

bors

commit sha 60c2e8d438f75aed5192dfa76e4b42a6739f6291

Auto merge of #75126 - JohnTitor:rollup-aejluzx, r=JohnTitor Rollup of 8 pull requests Successful merges: - #74759 (add `unsigned_abs` to signed integers) - #75043 (rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`) - #75056 (Lint path statements to suggest using drop when the type needs drop) - #75081 (Fix logging for rustdoc) - #75083 (Do not trigger `unused_braces` for `while let`) - #75084 (Stabilize Ident::new_raw) - #75103 (Disable building rust-analyzer on riscv64) - #75106 (Enable docs on in the x86_64-unknown-linux-musl manifest) Failed merges: r? @ghost

view details

push time in 7 days

pull request commentrust-lang/rust

Tweak `RawVec::reserve{,_exact}`.

@bors try @rust-timer queue

nnethercote

comment created time in 7 days

PR opened rust-lang/rust

Tweak `RawVec::reserve{,_exact}`.

r? @ghost

+16 -8

0 comment

1 changed file

pr created time in 7 days

create barnchnnethercote/rust

branch : tweak-RawVec-reserve

created branch time in 7 days

push eventnnethercote/rust

Erik Desjardins

commit sha c596e01b8ea34bb46444005425cd5aa825515f7b

add track_caller to RefCell::{borrow, borrow_mut} So panic messages point at the offending borrow.

view details

Camille GILLOT

commit sha e288d050127f0bf78b325ef4d34b8b697ce28c80

Introduce an abstraction for EvaluationCache and SelectionCache.

view details

Camille GILLOT

commit sha 2baefd3206b29b06f1cb55b91be9a2e380e7d2de

Move IntercrateAmbiguityCause to librustc_trait_selection.

view details

Camille GILLOT

commit sha 058e02145786ce50c86dd590d792271839907642

Use Lift derive proc-macro in librustc_traits.

view details

Stein Somers

commit sha f5c47fa44d64b7ae529147f9b0122b7ecda1bd92

Move bulk of BTreeMap::insert method down to new method on handle

view details

Vadim Petrochenkov

commit sha 0eacf02f01b4ea084a4f970e487ce6d3a6a20f90

tests: Ignore src/test/debuginfo/rc_arc.rs on Windows It requires loading pretty-printers, but GDB doesn't load them on Windows

view details

Tomasz Miąsko

commit sha 82651db9b2f6ecb16c773e8afa301c862118bb82

Fix change detection in CfgSimplifier::collapse_goto_chain Check that the old target is different from the new collapsed one, before concluding that anything changed.

view details

Tomasz Miąsko

commit sha 7f9f2ff9f40ed46a209cf232429120333fe42455

Remove redundant assignment from CfgSimplifier

view details

bors

commit sha 7637cbb79bad4fdc29906a21847096a997a13631

Auto merge of #75055 - cjgillot:clean-cache, r=oli-obk Introduce an abstraction for EvaluationCache and SelectionCache The small duplicated code has been moved to librustc_query_system. The remaining changes are some cleanups of structural impls.

view details

bors

commit sha 1b0ff9e7d0620daa86a80bf92f6b661f7699984e

Auto merge of #75068 - petrochenkov:ignore-debinfo, r=Mark-Simulacrum tests: Ignore src/test/debuginfo/rc_arc.rs on Windows It requires loading pretty-printers (`src\etc\gdb_load_rust_pretty_printers.py`), but GDB doesn't load them on Windows. Not sure how this passes through CI, due to an old GDB version perhaps?

view details

bors

commit sha dbc2ef25fb5e15445de38f19ba75547a6cf35cae

Auto merge of #75076 - tmiasko:simplify-goto, r=oli-obk Fix change detection in CfgSimplifier::collapse_goto_chain Check that the old target is different from the new collapsed one, before concluding that anything changed. Fixes #75074 Fixes #75051

view details

kennytm

commit sha fd7596c9a538b3c51f2d55c2d5f6ef881e6ba742

fix broken git commit in stdarch

view details

bors

commit sha c186aed59ab590eb586751afaf6b9e0ea9b78099

Auto merge of #75092 - kennytm:fix-75009, r=pietroalbini Fix broken git commit in stdarch Follow-up on #75009, point to the real master commit.

view details

bors

commit sha 829d69b9c6bfc535a92fc290ec9391a0d5af6c81

Auto merge of #74827 - ssomers:btree_cleanup_insert, r=Mark-Simulacrum Move bulk of BTreeMap::insert method down to new method on handle Adjust the boundary between the map and node layers for insertion: do more in the node layer, keep root manipulation and pointer dereferencing separate. No change in undefined behaviour or performance. r? @Mark-Simulacrum

view details

bors

commit sha d8cbd9caca648ecdb66ff4c945c060762aa6297f

Auto merge of #74526 - erikdesjardins:reftrack, r=Mark-Simulacrum Add track_caller to RefCell::{borrow, borrow_mut} So panic messages point at the offending borrow. Fixes #74472

view details

push time in 7 days

pull request commentrust-lang/rust

Clean up rustdoc's `main()`

@oli-obk: not sure if you're the best reviewer, I chose you because you did #55617 which is somewhat related. Feel free to forward the review to someone else if necessary.

nnethercote

comment created time in 7 days

PR opened rust-lang/rust

Clean up rustdoc's `main()`

It can be simplified and made more similar to rustc's main().

r? @oli-obk

+46 -67

0 comment

2 changed files

pr created time in 7 days

create barnchnnethercote/rust

branch : clean-up-rustdoc-main

created branch time in 7 days

Pull request review commentrust-lang/rust

rustc_metadata: track the simplified Self type for every trait impl.

 pub(super) fn all_local_trait_impls<'tcx>( pub(super) fn trait_impls_of_provider(tcx: TyCtxt<'_>, trait_id: DefId) -> TraitImpls {     let mut impls = TraitImpls::default(); -    {-        let mut add_impl = |impl_def_id: DefId| {-            let impl_self_ty = tcx.type_of(impl_def_id);

#65750 introduced a specialized representation for doc comments, that might be what you are referring to.

eddyb

comment created time in 7 days

PR closed rust-lang/rust

Avoid `Layout::array()` in `raw_vec.rs`. S-waiting-on-review

A non-generic equivalent results in less LLVM IR and faster compilation.

r? @amanieu

+19 -8

7 comments

1 changed file

nnethercote

pr closed time in 7 days

pull request commentrust-lang/rust

Avoid `Layout::array()` in `raw_vec.rs`.

This gave me wins of up to 1.9% locally, but changes to this code can be unpredictable in terms of performance, so let's see what it looks like on CI.

@bors try @rust-timer queue

nnethercote

comment created time in 8 days

PR opened rust-lang/rust

Avoid `Layout::array()` in `raw_vec.rs`.

A non-generic equivalent results in less LLVM IR and faster compilation.

r? @amanieu

+19 -8

0 comment

1 changed file

pr created time in 8 days

create barnchnnethercote/rust

branch : avoid-Layout-array

created branch time in 8 days

issue commentrust-lang/rust

`ParamEnv::def_id` is expensive

Is there a clear path forward for this? I'm happy to help but I know nothing about Chalk...

nnethercote

comment created time in 8 days

push eventnnethercote/rust

Lzu Tao

commit sha 07575286b81da73d88c29e4581fdcc9dec3508ed

Remove as_deref_err and as_deref_mut_err from Result

view details

Lzu Tao

commit sha c25f25f7f18728eef288c45f77477232b9c5d203

Stabilize as_deref and as_deref on Result

view details

Lzu Tao

commit sha 6d293ede9f0790e1a450113bfbda0998fec9e48c

Update tests

view details

Yuki Okushi

commit sha 86d0b9cbd0242b06a747b14903dfbd4fda911a1d

Do not trigger `unused_{braces,parens}` lints with `yield`

view details

David Wood

commit sha 86f80d3ba8d81b29e66ad415219e60c3f1d48a6b

pprust: adjust mixed comment printing This commit adjusts the pretty printing of mixed comments so that the initial zero-break isn't emitted at the beginning of the line. Through this, the `block-comment-wchar` test can have the `pp-exact` file removed, as it no longer converges from pretty printing of the source. Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha c773226aba7d54fc55fdd6244fb6395a5487f656

tests: add regression test for #74745 This commit adds a regression test for #74745. While a `ignore-tidy-trailing-lines` header is required, this doesn't stop the test from reproducing, so long as there is no newline at the end of the file. However, adding the header comments made the test fail due to a bug in pprust, fixed in the previous commit. Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 1530563bd7a3880eec14d78e4a715c1bc4e24074

compiletest: print diff for pretty tests This commit modifies compiletest so that a diff of actual and expected output is shown for pretty tests. This makes it far easier to work out what has changed. Signed-off-by: David Wood <david@davidtw.co>

view details

liuzhenyu

commit sha 3b4151c9f3f66894a8d9f2d313f406ad21abf00d

fix typos

view details

Georgio Nicolas

commit sha 1e2ce28ec0fb4d906bb97dbe808a75e2f646981c

Document the discrepancy in the mask type for _mm_shuffle_ps

view details

Yuki Okushi

commit sha 2e7ba785b34b040154761d42bdd4a208707e0d29

Recover strictness for `yield`

view details

Vadim Petrochenkov

commit sha d3277b927aa195d644069d4a7c2150a5bf760285

compiletest: Support ignoring tests requiring missing LLVM components

view details

Manish Goregaokar

commit sha bf4a37d9611239fc89f25e0a9c47d71bd43f1450

Rollup merge of #74980 - davidtwco:issue-74745-pprust-regression-test, r=petrochenkov pprust: adjust mixed comment printing and add regression test for #74745 Fixes #74745. This PR adds a regression test for #74745. While a `ignore-tidy-trailing-lines` header is required, this doesn't stop the test from reproducing, so long as there is no newline at the end of the file. However, adding the header comments made the test fail due to a bug in pprust - so this PR also adjusts the pretty printing of mixed comments so that the initial zero-break isn't emitted at the beginning of the line. Through this, the `block-comment-wchar` test can have the `pp-exact` file removed, as it no longer converges from pretty printing of the source.

view details

Manish Goregaokar

commit sha 1b350ecb60aa1ec1d0eb58b43ebf6a335dc8076c

Rollup merge of #75009 - georgio:master, r=kennytm Document the discrepancy in the mask type for _mm_shuffle_ps This Pull Request updates the `stdarch` submodule in order to resolve #62490

view details

Manish Goregaokar

commit sha db3e10f9cb6b2e925ae73cd5230df98746640b34

Rollup merge of #75031 - JohnTitor:unused-parens-braces-yield, r=lcnr Do not trigger `unused_{braces,parens}` lints with `yield` Fixes #74883 r? @lcnr

view details

Manish Goregaokar

commit sha 9471ab068c13962034afd6e4eb3b0841b723e996

Rollup merge of #75059 - shengsheng:typos, r=Dylan-DPC fix typos Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines

view details

Manish Goregaokar

commit sha 0bf2dcf059e4c344d9a9c54cffe4d51543deb2ee

Rollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-Simulacrum compiletest: Support ignoring tests requiring missing LLVM components This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084. Builds of LLVM backends take a lot of time and disk space. So it usually makes sense to build rustc with ```toml [llvm] targets = "X86" experimental-targets = "" ``` unless you are working on some target-specific tasks. A few tests, however, require non-x86 backends to be built. A new test directive `// needs-llvm-components: component1 component2 component3` makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through `llvm-config --components`). As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is ``` aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` (With the default target list it's much larger.) ``` aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` https://github.com/rust-lang/rust/pull/66084 is also reverted now. r? @Mark-Simulacrum

view details

bors

commit sha 81e754c359c471f91263813c46c67955071716a7

Auto merge of #75070 - Manishearth:rollup-2kgcaw5, r=Manishearth Rollup of 5 pull requests Successful merges: - #74980 (pprust: adjust mixed comment printing and add regression test for #74745) - #75009 (Document the discrepancy in the mask type for _mm_shuffle_ps) - #75031 (Do not trigger `unused_{braces,parens}` lints with `yield`) - #75059 (fix typos) - #75064 (compiletest: Support ignoring tests requiring missing LLVM components) Failed merges: r? @ghost

view details

Nicholas Nethercote

commit sha d93277b9150d50fae4b086cd6efe2a006b3d88da

Remove `GCX_PTR`. We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows implicit access to a `GlobalCtxt` and some other things. We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same `GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR` is only used in the parallel compiler's `handle_deadlock()` function. This commit does the following. - It removes `GCX_PTR`. - It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now equivalent to the old `tls::enter_global()`. - Makes `tls::get_tlv()` public for the parallel compiler, because it's now used in `handle_deadlock()`.

view details

Nicholas Nethercote

commit sha 8c78fd234be2b3adfeda8748379370e5b8433ce3

Use more appropriate `tls::with_*` methods in some places.

view details

bors

commit sha 19ecce332e56941ea0dd2a805270faa102acdb14

Auto merge of #74948 - lzutao:stalize-result-as-deref, r=dtolnay Stabilize `Result::as_deref` and `as_deref_mut` FCP completed in https://github.com/rust-lang/rust/issues/50264#issuecomment-645681400. This PR stabilizes two new APIs for `std::result::Result`: ```rust fn as_deref(&self) -> Result<&T::Target, &E> where T: Deref; fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut; ``` This PR also removes two rarely used unstable APIs from `Result`: ```rust fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref; fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut; ``` Closes #50264

view details

push time in 8 days

delete branch nnethercote/rust

delete branch : rm-GCX_PTR

delete time in 8 days

Pull request review commentrust-lang/rust

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

 impl Attribute {         }     } -    /// Returns `true` if the attribute's path matches the argument. If it matches, then the-    /// attribute is marked as used.+    /// Returns `true` if the attribute's path matches the argument.+    /// If it matches, then the attribute is marked as used.+    /// Should only be used by rustc, other tools can use `has_name` instead.

Can you expand this comment slightly, to explain that other tools don't do error reporting relating to attribute use?

petrochenkov

comment created time in 8 days

pull request commentrust-lang/rust

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

Why do we not have to track usage for MetaItem and NestedMetaItem? Is it worth a comment in the code explaining this?

Also, #74932 will still be relevant after this lands, right? It will just be smaller and simpler.

r=me once the extra comment or two has been added. Thanks for doing this.

petrochenkov

comment created time in 8 days

pull request commentrust-lang/rust

Remove `GCX_PTR`.

I have rebased.

@bors r=Mark-Simulacrum

nnethercote

comment created time in 8 days

push eventnnethercote/rust

Aaron Hill

commit sha ac9dfc3e7785c9bba96ebac4fd51726189e1bf91

Normalize opaque types when converting `ParamEnv` to `Reveal::All` Fixes #65918

view details

Aaron Hill

commit sha 117a60e1f5045e317d3f76ce60be28d18c694608

Erase regions in try_eval_bits

view details

Aaron Hill

commit sha 90aee14eb95ac0b9ddb7cf5db6d003155e94800c

Skip computing param_env and size if not needed

view details

Aaron Hill

commit sha 5e2e927e0107916b825b164c82be44877ac6ab54

Fix rebase fallout

view details

Pietro Albini

commit sha cb76f821942053091706b7bb2c4dc416bb09bfb9

ci: avoid symlinking the build directory on self-hosted builders

view details

Pietro Albini

commit sha fe5a40eb14f233554a30c038cf8944b2d2adf9ff

ci: add aarch64-gnu as a fallible auto builder

view details

Guillaume Gomez

commit sha 403164569170e3f5c06db8b66257ac61db7cff4b

Clean up E0728 explanation

view details

Guillaume Gomez

commit sha 1d2e3fff69b654c3dfd6a810e193db29bb1868fa

Clean up E0730 explanation

view details

Andy Russell

commit sha 0b320086425937b17bda5ee9e856ac6441d71d96

report kind of deprecated item in message This is important for fields, which are incorrectly referred to as "items".

view details

Guillaume Gomez

commit sha f22a34e84d4dba9b17bb3e68051ee82bd85f3c94

Clean up E0734 explanation

view details

Alan Somers

commit sha 013e1a6e9f73125734cb919d9b6220b3a4710d67

Enable the profiler on FreeBSD FreeBSD has been doing this in our own package builds for two months now. https://svnweb.freebsd.org/ports?view=revision&revision=535771

view details

Nathaniel McCallum

commit sha 25670749b44a9c7a4cfd3fbf780bbe3344a9a6c5

Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408

view details

Michal 'vorner' Vaner

commit sha ad6d63ef01e37a1a05acdba50985b01d178d7c11

Don't use "weak count" around Weak::from_raw_ptr As `Rc/Arc::weak_count` returns 0 when having no strong counts, this could be confusing and it's better to avoid using that completely. Closes #73840.

view details

David Sonder

commit sha b5d143b126cd73c873fc8feff7dee0a0b077cc84

Enable docs on dist-x86_64-musl Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

view details

Stein Somers

commit sha c4f4639e1a2eb07d17e7393a1c7f0594f0c11faf

Remove into_slices and its unsafe block

view details

Oliver Scherer

commit sha 5e96bb459377896a85be4a192e16feca4c1d4aaf

Replace all uses of `log::log_enabled` with `Debug` printers

view details

Alexis Bourget

commit sha 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5

Clarify the doc for MaybeUninit::zeroed on incorrect use

view details

Oliver Scherer

commit sha 7d67a1b871c41fb498eeffcadfa33f1fa4c35774

Replace write-to-vec hack by introducing a display renderer for allocations

view details

Alex Crichton

commit sha 06d565c967bfb7c6ff52a991bbe47b4a2a25de3e

std: Switch from libbacktrace to gimli This commit is a proof-of-concept for switching the standard library's backtrace symbolication mechanism on most platforms from libbacktrace to gimli. The standard library's support for `RUST_BACKTRACE=1` requires in-process parsing of object files and DWARF debug information to interpret it and print the filename/line number of stack frames as part of a backtrace. Historically this support in the standard library has come from a library called "libbacktrace". The libbacktrace library seems to have been extracted from gcc at some point and is written in C. We've had a lot of issues with libbacktrace over time, unfortunately, though. The library does not appear to be actively maintained since we've had patches sit for months-to-years without comments. We have discovered a good number of soundness issues with the library itself, both when parsing valid DWARF as well as invalid DWARF. This is enough of an issue that the libs team has previously decided that we cannot feed untrusted inputs to libbacktrace. This also doesn't take into account the portability of libbacktrace which has been difficult to manage and maintain over time. While possible there are lots of exceptions and it's the main C dependency of the standard library right now. For years it's been the desire to switch over to a Rust-based solution for symbolicating backtraces. It's been assumed that we'll be using the Gimli family of crates for this purpose, which are targeted at safely and efficiently parsing DWARF debug information. I've been working recently to shore up the Gimli support in the `backtrace` crate. As of a few weeks ago the `backtrace` crate, by default, uses Gimli when loaded from crates.io. This transition has gone well enough that I figured it was time to start talking seriously about this change to the standard library. This commit is a preview of what's probably the best way to integrate the `backtrace` crate into the standard library with the Gimli feature turned on. While today it's used as a crates.io dependency, this commit switches the `backtrace` crate to a submodule of this repository which will need to be updated manually. This is not done lightly, but is thought to be the best solution. The primary reason for this is that the `backtrace` crate needs to do some pretty nontrivial filesystem interactions to locate debug information. Working without `std::fs` is not an option, and while it might be possible to do some sort of trait-based solution when prototyped it was found to be too unergonomic. Using a submodule allows the `backtrace` crate to build as a submodule of the `std` crate itself, enabling it to use `std::fs` and such. Otherwise this adds new dependencies to the standard library. This step requires extra attention because this means that these crates are now going to be included with all Rust programs by default. It's important to note, however, that we're already shipping libbacktrace with all Rust programs by default and it has a bunch of C code implementing all of this internally anyway, so we're basically already switching already-shipping functionality to Rust from C. * `object` - this crate is used to parse object file headers and contents. Very low-level support is used from this crate and almost all of it is disabled. Largely we're just using struct definitions as well as convenience methods internally to read bytes and such. * `addr2line` - this is the main meat of the implementation for symbolication. This crate depends on `gimli` for DWARF parsing and then provides interfaces needed by the `backtrace` crate to turn an address into a filename / line number. This crate is actually pretty small (fits in a single file almost!) and mirrors most of what `dwarf.c` does for libbacktrace. * `miniz_oxide` - the libbacktrace crate transparently handles compressed debug information which is compressed with zlib. This crate is used to decompress compressed debug sections. * `gimli` - not actually used directly, but a dependency of `addr2line`. * `adler32`- not used directly either, but a dependency of `miniz_oxide`. The goal of this change is to improve the safety of backtrace symbolication in the standard library, especially in the face of possibly malformed DWARF debug information. Even to this day we're still seeing segfaults in libbacktrace which could possibly become security vulnerabilities. This change should almost entirely eliminate this possibility whilc also paving the way forward to adding more features like split debug information. Some references for those interested are: * Original addition of libbacktrace - #12602 * OOM with libbacktrace - #24231 * Backtrace failure due to use of uninitialized value - #28447 * Possibility to feed untrusted data to libbacktrace - #21889 * Soundness fix for libbacktrace - #33729 * Crash in libbacktrace - #39468 * Support for macOS, never merged - ianlancetaylor/libbacktrace#2 * Performance issues with libbacktrace - #29293, #37477 * Update procedure is quite complicated due to how many patches we need to carry - #50955 * Libbacktrace doesn't work on MinGW with dynamic libs - #71060 * Segfault in libbacktrace on macOS - #71397 Switching to Rust will not make us immune to all of these issues. The crashes are expected to go away, but correctness and performance may still have bugs arise. The gimli and `backtrace` crates, however, are actively maintained unlike libbacktrace, so this should enable us to at least efficiently apply fixes as situations come up.

view details

Paul Sajna

commit sha 7baa87fccf2d9788530e6efc762d326d47d68617

bump libc version to 0.2.74

view details

push time in 8 days

push eventnnethercote/rust

Aaron Hill

commit sha ac9dfc3e7785c9bba96ebac4fd51726189e1bf91

Normalize opaque types when converting `ParamEnv` to `Reveal::All` Fixes #65918

view details

Aaron Hill

commit sha 117a60e1f5045e317d3f76ce60be28d18c694608

Erase regions in try_eval_bits

view details

Aaron Hill

commit sha 90aee14eb95ac0b9ddb7cf5db6d003155e94800c

Skip computing param_env and size if not needed

view details

Aaron Hill

commit sha 5e2e927e0107916b825b164c82be44877ac6ab54

Fix rebase fallout

view details

Pietro Albini

commit sha cb76f821942053091706b7bb2c4dc416bb09bfb9

ci: avoid symlinking the build directory on self-hosted builders

view details

Pietro Albini

commit sha fe5a40eb14f233554a30c038cf8944b2d2adf9ff

ci: add aarch64-gnu as a fallible auto builder

view details

Guillaume Gomez

commit sha 403164569170e3f5c06db8b66257ac61db7cff4b

Clean up E0728 explanation

view details

Guillaume Gomez

commit sha 1d2e3fff69b654c3dfd6a810e193db29bb1868fa

Clean up E0730 explanation

view details

Andy Russell

commit sha 0b320086425937b17bda5ee9e856ac6441d71d96

report kind of deprecated item in message This is important for fields, which are incorrectly referred to as "items".

view details

Guillaume Gomez

commit sha f22a34e84d4dba9b17bb3e68051ee82bd85f3c94

Clean up E0734 explanation

view details

Alan Somers

commit sha 013e1a6e9f73125734cb919d9b6220b3a4710d67

Enable the profiler on FreeBSD FreeBSD has been doing this in our own package builds for two months now. https://svnweb.freebsd.org/ports?view=revision&revision=535771

view details

Nathaniel McCallum

commit sha 25670749b44a9c7a4cfd3fbf780bbe3344a9a6c5

Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408

view details

Michal 'vorner' Vaner

commit sha ad6d63ef01e37a1a05acdba50985b01d178d7c11

Don't use "weak count" around Weak::from_raw_ptr As `Rc/Arc::weak_count` returns 0 when having no strong counts, this could be confusing and it's better to avoid using that completely. Closes #73840.

view details

David Sonder

commit sha b5d143b126cd73c873fc8feff7dee0a0b077cc84

Enable docs on dist-x86_64-musl Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

view details

Stein Somers

commit sha c4f4639e1a2eb07d17e7393a1c7f0594f0c11faf

Remove into_slices and its unsafe block

view details

Oliver Scherer

commit sha 5e96bb459377896a85be4a192e16feca4c1d4aaf

Replace all uses of `log::log_enabled` with `Debug` printers

view details

Alexis Bourget

commit sha 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5

Clarify the doc for MaybeUninit::zeroed on incorrect use

view details

Oliver Scherer

commit sha 7d67a1b871c41fb498eeffcadfa33f1fa4c35774

Replace write-to-vec hack by introducing a display renderer for allocations

view details

Alex Crichton

commit sha 06d565c967bfb7c6ff52a991bbe47b4a2a25de3e

std: Switch from libbacktrace to gimli This commit is a proof-of-concept for switching the standard library's backtrace symbolication mechanism on most platforms from libbacktrace to gimli. The standard library's support for `RUST_BACKTRACE=1` requires in-process parsing of object files and DWARF debug information to interpret it and print the filename/line number of stack frames as part of a backtrace. Historically this support in the standard library has come from a library called "libbacktrace". The libbacktrace library seems to have been extracted from gcc at some point and is written in C. We've had a lot of issues with libbacktrace over time, unfortunately, though. The library does not appear to be actively maintained since we've had patches sit for months-to-years without comments. We have discovered a good number of soundness issues with the library itself, both when parsing valid DWARF as well as invalid DWARF. This is enough of an issue that the libs team has previously decided that we cannot feed untrusted inputs to libbacktrace. This also doesn't take into account the portability of libbacktrace which has been difficult to manage and maintain over time. While possible there are lots of exceptions and it's the main C dependency of the standard library right now. For years it's been the desire to switch over to a Rust-based solution for symbolicating backtraces. It's been assumed that we'll be using the Gimli family of crates for this purpose, which are targeted at safely and efficiently parsing DWARF debug information. I've been working recently to shore up the Gimli support in the `backtrace` crate. As of a few weeks ago the `backtrace` crate, by default, uses Gimli when loaded from crates.io. This transition has gone well enough that I figured it was time to start talking seriously about this change to the standard library. This commit is a preview of what's probably the best way to integrate the `backtrace` crate into the standard library with the Gimli feature turned on. While today it's used as a crates.io dependency, this commit switches the `backtrace` crate to a submodule of this repository which will need to be updated manually. This is not done lightly, but is thought to be the best solution. The primary reason for this is that the `backtrace` crate needs to do some pretty nontrivial filesystem interactions to locate debug information. Working without `std::fs` is not an option, and while it might be possible to do some sort of trait-based solution when prototyped it was found to be too unergonomic. Using a submodule allows the `backtrace` crate to build as a submodule of the `std` crate itself, enabling it to use `std::fs` and such. Otherwise this adds new dependencies to the standard library. This step requires extra attention because this means that these crates are now going to be included with all Rust programs by default. It's important to note, however, that we're already shipping libbacktrace with all Rust programs by default and it has a bunch of C code implementing all of this internally anyway, so we're basically already switching already-shipping functionality to Rust from C. * `object` - this crate is used to parse object file headers and contents. Very low-level support is used from this crate and almost all of it is disabled. Largely we're just using struct definitions as well as convenience methods internally to read bytes and such. * `addr2line` - this is the main meat of the implementation for symbolication. This crate depends on `gimli` for DWARF parsing and then provides interfaces needed by the `backtrace` crate to turn an address into a filename / line number. This crate is actually pretty small (fits in a single file almost!) and mirrors most of what `dwarf.c` does for libbacktrace. * `miniz_oxide` - the libbacktrace crate transparently handles compressed debug information which is compressed with zlib. This crate is used to decompress compressed debug sections. * `gimli` - not actually used directly, but a dependency of `addr2line`. * `adler32`- not used directly either, but a dependency of `miniz_oxide`. The goal of this change is to improve the safety of backtrace symbolication in the standard library, especially in the face of possibly malformed DWARF debug information. Even to this day we're still seeing segfaults in libbacktrace which could possibly become security vulnerabilities. This change should almost entirely eliminate this possibility whilc also paving the way forward to adding more features like split debug information. Some references for those interested are: * Original addition of libbacktrace - #12602 * OOM with libbacktrace - #24231 * Backtrace failure due to use of uninitialized value - #28447 * Possibility to feed untrusted data to libbacktrace - #21889 * Soundness fix for libbacktrace - #33729 * Crash in libbacktrace - #39468 * Support for macOS, never merged - ianlancetaylor/libbacktrace#2 * Performance issues with libbacktrace - #29293, #37477 * Update procedure is quite complicated due to how many patches we need to carry - #50955 * Libbacktrace doesn't work on MinGW with dynamic libs - #71060 * Segfault in libbacktrace on macOS - #71397 Switching to Rust will not make us immune to all of these issues. The crashes are expected to go away, but correctness and performance may still have bugs arise. The gimli and `backtrace` crates, however, are actively maintained unlike libbacktrace, so this should enable us to at least efficiently apply fixes as situations come up.

view details

Paul Sajna

commit sha 7baa87fccf2d9788530e6efc762d326d47d68617

bump libc version to 0.2.74

view details

push time in 8 days

pull request commentrust-lang/rust

Remove `GCX_PTR`.

Unfortunately #50699 has zero additional explanation beyond what is already in the code :(

nnethercote

comment created time in 8 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha b0a258fe0513207e45dc529fb1517f1795914da2

Use more appropriate `tls::with_*` methods in some places.

view details

push time in 11 days

push eventnnethercote/rust

Nicholas Nethercote

commit sha 1e81a84124a870c442d2063e1e4f1a9232461b89

Use more appropriate `tls::with_*` methods in some places.

view details

push time in 11 days

pull request commentrust-lang/rust

Remove `GCX_PTR`.

I'm not totally confident about the new code in deadlock_handler(). I don't know if that code is tested. The parallel compiler's behaviour is unchanged -- it bootstraps and then fails on the same five tests as normal.

nnethercote

comment created time in 11 days

PR opened rust-lang/rust

Remove `GCX_PTR`.

We store an ImplicitCtxt pointer in a thread-local value (TLV). This allows implicit access to a GlobalCtxt and some other things.

We also store a GlobalCtxt pointer in GCX_PTR. This is always the same GlobalCtxt as the one within the ImplicitCtxt pointer in TLV. GCX_PTR is only used in the parallel compiler's handle_deadlock() function.

This commit does the following.

  • It removes GCX_PTR.
  • It also adds ImplicitCtxt::new(), which constructs an ImplicitCtxt from a GlobalCtxt. ImplicitCtxt::new() + tls::enter_context() is now equivalent to the old tls::enter_global().
  • Makes tls::get_tlv() public for the parallel compiler, because it's now used in handle_deadlock().

r? @petrochenkov

+33 -75

0 comment

7 changed files

pr created time in 11 days

create barnchnnethercote/rust

branch : rm-GCX_PTR

created branch time in 11 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_span = { path = "../librustc_span" } rustc_serialize = { path = "../librustc_serialize" }+rustc_session = { path = "../librustc_session" }

Is there any documentation on which crates should/can depend on others?

There are only two functions in librustc_hir that call check_name, so avoiding this dependency hopefully won't be too hard.

nnethercote

comment created time in 11 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I suspect that majority of these check_names don't actually need to mark the attributes as used.

I was wondering about that, but I had no sense of which were necessary and which weren't, so I kept them all except for the couple that I couldn't keep. It'd be great if there was a clear rule about when check_name is needed.

nnethercote

comment created time in 11 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

@bors try @rust-timer queue

nnethercote

comment created time in 12 days

push eventnnethercote/rust

Guillaume Gomez

commit sha 633d1a5af96db7eccb8aeeb07ff31b06aaf07b5f

Clean up E0720 explanation

view details

Dan Aloni

commit sha 28e27566782e5f2636b9c93a172c19024630233d

librustc_typeck: use diag item instead of string compare

view details

Dan Aloni

commit sha d077767ee72221f2a436692ef85115381671a765

Update src/librustc_typeck/check/op.rs Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>

view details

Bastian Kauschke

commit sha 49b1971263971db49e821f81bb54991b7de5ab43

add const generics

view details

Rich Kadel

commit sha 12ddd6073abecb7a515a43bee37408596e322345

Fixed coverage map issues; better aligned with LLVM APIs Found some problems with the coverage map encoding when testing with more than one counter per function. While debugging, I realized some better ways to structure the Rust implementation of the coverage mapping generator. I refactored somewhat, resulting in less code overall, expanded coverage of LLVM Coverage Map capabilities, and much closer alignment with LLVM data structures, APIs, and naming. This should be easier to follow and easier to maintain.

view details

Ximin Luo

commit sha 1f25a4b3ae87327f045fbfec82b5af4c8da6ecd6

config.toml.example: Update remap-debuginfo doc to be more general & accurate

view details

Joseph Ryan

commit sha c692ed468c8dc4b9f549ef839b4b490e3b84d19c

Move `Error` and `RenderInfo` out of `html` module

view details

Joseph Ryan

commit sha 5bc97946ca35a789b690668bb6b27ca41bfeb5b2

Refactor html backend to use generic interface

view details

Joseph Ryan

commit sha 6a4396b98c6fcb405429a9798a9ab6554f015b7e

Extract `Cache` and other types from `html` module

view details

Joseph Ryan

commit sha a7909522547cb35b32a4f11b78b2b54864189295

Pull out more types from html

view details

Joseph Ryan

commit sha 65bf5d5248635152262344770591c367ba6a9890

TODO -> FIXME

view details

Joseph Ryan

commit sha 3d707a008e0822471de4adad047b5cefd281f3ac

Make requested changes

view details

Joseph Ryan

commit sha cee8023c690158daf4f6c3d8bf2d32297fdfed0c

More requested changes

view details

Tomasz Miąsko

commit sha 821d50aa0cc73c1ec2fb09bab8a69e1c3ca93f23

Make closures and generators a must use types Warn about unused expressions with closure or generator type. This follows existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn` traits, which already indirectly apply to closures in some cases, e.g.,: ```rust fn f() -> impl FnOnce() { || {} } fn main() { // an existing warning: unused implementer of `std::ops::FnOnce` that must be used: f(); // a new warning: unused closure that must be used: || {}; } ```

view details

Joshua Nelson

commit sha 617d10975ef1db8ab9fcf3b5720a147f36b69f41

Separate `missing_doc_code_examples` from intra-doc links These two lints have no relation other than both being nightly-only. This allows stabilizing intra-doc links without stabilizing missing_doc_code_examples.

view details

Joshua Nelson

commit sha def61777083d938a75718d55ba6c6600d4923d6d

Move `look_for_tests` to `private_items_doc_tests`

view details

Who? Me?!

commit sha 62fd2c81e36f0efadf4c5fc8e5576bcdfb66ac18

Update outdated readme

view details

Joshua Nelson

commit sha d34a1b0c1b4b22cc61b5956c07d89517bf278af8

Don't duplicate builder code - Add Builder::new_internal

view details

Joshua Nelson

commit sha 0192fa4786db80d2c9888af98e7ceec47d327887

Make the default stage dependent on the subcommand ### x.py build/test: stage 1 I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd twice and don't give you much more information than a stage 1 build (except in rare cases like https://github.com/rust-lang/rust/pull/68692#discussion_r376392145). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use `--stage 2` I see no downside here. ### x.py bench/dist/install: stage 2 These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build. ### x.py doc: stage 0 Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1. Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: https://github.com/rust-lang/rust/pull/73101. However most of the time this will not be the case.

view details

Joshua Nelson

commit sha f7dcfcd45bd019acf8c914c204ccae519c420adc

Don't build rustc without std - Set rustc to build only when explicitly asked for This allows building the stage2 rustc artifacts, which nothing depends on. Previously the behavior was as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd): - `x.py build --stage 0`: - stage0 libstd - stage1 rustc (but without putting rustc in stage0/) This leaves you without any rustc at all except for the beta compiler (https://github.com/rust-lang/rust/issues/73519). This is never what you want. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc - stage2 rustc This leaves you with a broken stage2 rustc which doesn't even have libcore and is effectively useless. Additionally, it compiles rustc twice, which is not normally what you want. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 rustdoc and tools This builds all tools in release mode. This is the correct usage for CI, but takes far to long for development. Now the behavior is as follows: - `x.py build --stage 0`: - stage0 libstd This is suitable for contributors only working on the standard library, as it means rustc never has to be compiled. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc This is suitable for contributors working on the compiler. It ensures that you have a working rustc and libstd without having to pass `src/libstd` in addition. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc This is suitable for debugging errors which only appear with the stage2 compiler. - `x.py build --stage 2 src/libstd src/rustc` - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc, tools, etc. - stage2 rustc artifacts ('stage3') This is suitable for CI, which wants all tools in release mode. However, most of the use cases for this should use `x.py dist` instead, which builds all the tools without each having to be named individually.

view details

push time in 12 days

push eventnnethercote/rust

Guillaume Gomez

commit sha 633d1a5af96db7eccb8aeeb07ff31b06aaf07b5f

Clean up E0720 explanation

view details

Dan Aloni

commit sha 28e27566782e5f2636b9c93a172c19024630233d

librustc_typeck: use diag item instead of string compare

view details

Dan Aloni

commit sha d077767ee72221f2a436692ef85115381671a765

Update src/librustc_typeck/check/op.rs Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>

view details

Bastian Kauschke

commit sha 49b1971263971db49e821f81bb54991b7de5ab43

add const generics

view details

Rich Kadel

commit sha 12ddd6073abecb7a515a43bee37408596e322345

Fixed coverage map issues; better aligned with LLVM APIs Found some problems with the coverage map encoding when testing with more than one counter per function. While debugging, I realized some better ways to structure the Rust implementation of the coverage mapping generator. I refactored somewhat, resulting in less code overall, expanded coverage of LLVM Coverage Map capabilities, and much closer alignment with LLVM data structures, APIs, and naming. This should be easier to follow and easier to maintain.

view details

Ximin Luo

commit sha 1f25a4b3ae87327f045fbfec82b5af4c8da6ecd6

config.toml.example: Update remap-debuginfo doc to be more general & accurate

view details

Joseph Ryan

commit sha c692ed468c8dc4b9f549ef839b4b490e3b84d19c

Move `Error` and `RenderInfo` out of `html` module

view details

Joseph Ryan

commit sha 5bc97946ca35a789b690668bb6b27ca41bfeb5b2

Refactor html backend to use generic interface

view details

Joseph Ryan

commit sha 6a4396b98c6fcb405429a9798a9ab6554f015b7e

Extract `Cache` and other types from `html` module

view details

Joseph Ryan

commit sha a7909522547cb35b32a4f11b78b2b54864189295

Pull out more types from html

view details

Joseph Ryan

commit sha 65bf5d5248635152262344770591c367ba6a9890

TODO -> FIXME

view details

Joseph Ryan

commit sha 3d707a008e0822471de4adad047b5cefd281f3ac

Make requested changes

view details

Joseph Ryan

commit sha cee8023c690158daf4f6c3d8bf2d32297fdfed0c

More requested changes

view details

Tomasz Miąsko

commit sha 821d50aa0cc73c1ec2fb09bab8a69e1c3ca93f23

Make closures and generators a must use types Warn about unused expressions with closure or generator type. This follows existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn` traits, which already indirectly apply to closures in some cases, e.g.,: ```rust fn f() -> impl FnOnce() { || {} } fn main() { // an existing warning: unused implementer of `std::ops::FnOnce` that must be used: f(); // a new warning: unused closure that must be used: || {}; } ```

view details

Joshua Nelson

commit sha 617d10975ef1db8ab9fcf3b5720a147f36b69f41

Separate `missing_doc_code_examples` from intra-doc links These two lints have no relation other than both being nightly-only. This allows stabilizing intra-doc links without stabilizing missing_doc_code_examples.

view details

Joshua Nelson

commit sha def61777083d938a75718d55ba6c6600d4923d6d

Move `look_for_tests` to `private_items_doc_tests`

view details

Who? Me?!

commit sha 62fd2c81e36f0efadf4c5fc8e5576bcdfb66ac18

Update outdated readme

view details

Joshua Nelson

commit sha d34a1b0c1b4b22cc61b5956c07d89517bf278af8

Don't duplicate builder code - Add Builder::new_internal

view details

Joshua Nelson

commit sha 0192fa4786db80d2c9888af98e7ceec47d327887

Make the default stage dependent on the subcommand ### x.py build/test: stage 1 I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd twice and don't give you much more information than a stage 1 build (except in rare cases like https://github.com/rust-lang/rust/pull/68692#discussion_r376392145). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use `--stage 2` I see no downside here. ### x.py bench/dist/install: stage 2 These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build. ### x.py doc: stage 0 Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1. Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: https://github.com/rust-lang/rust/pull/73101. However most of the time this will not be the case.

view details

Joshua Nelson

commit sha f7dcfcd45bd019acf8c914c204ccae519c420adc

Don't build rustc without std - Set rustc to build only when explicitly asked for This allows building the stage2 rustc artifacts, which nothing depends on. Previously the behavior was as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd): - `x.py build --stage 0`: - stage0 libstd - stage1 rustc (but without putting rustc in stage0/) This leaves you without any rustc at all except for the beta compiler (https://github.com/rust-lang/rust/issues/73519). This is never what you want. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc - stage2 rustc This leaves you with a broken stage2 rustc which doesn't even have libcore and is effectively useless. Additionally, it compiles rustc twice, which is not normally what you want. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 rustdoc and tools This builds all tools in release mode. This is the correct usage for CI, but takes far to long for development. Now the behavior is as follows: - `x.py build --stage 0`: - stage0 libstd This is suitable for contributors only working on the standard library, as it means rustc never has to be compiled. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc This is suitable for contributors working on the compiler. It ensures that you have a working rustc and libstd without having to pass `src/libstd` in addition. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc This is suitable for debugging errors which only appear with the stage2 compiler. - `x.py build --stage 2 src/libstd src/rustc` - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc, tools, etc. - stage2 rustc artifacts ('stage3') This is suitable for CI, which wants all tools in release mode. However, most of the use cases for this should use `x.py dist` instead, which builds all the tools without each having to be named individually.

view details

push time in 12 days

more