profile
viewpoint

http-rs/async-h1 145

Asynchronous HTTP/1.1 in Rust

oli-obk/camera_capture 40

Crate for capturing images from a webcam

embed-rs/embedded-rs 15

Rust embed crate

mbr/mealy-rs 1

Worlds smallest crate.

oli-obk/bareboard 1

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.

Lireer/ricochet-robot-solver 0

Solver for ricochet robots written in rust

Manishearth/rfcs 0

RFCs for changes to Rust

oli-obk/agsxmpp 0

Smuxi's agsXMPP Fork

pull request commentrust-lang/rust

Revert "Rollup merge of #92006 - oli-obk:welcome_opaque_types_into_th…

@bors try @rust-timer queue

Let's run this again, apperently keccak is spurious recently

matthiaskrgr

comment created time in 3 hours

pull request commentrust-lang/rust

allow eq constraints on associated constants

@bors r+

JulianKnodt

comment created time in 14 hours

Pull request review commentrust-lang/rust

Revert "Rollup merge of #92006 - oli-obk:welcome_opaque_types_into_th…

 where      fn fully_perform(self, infcx: &InferCtxt<'_, 'tcx>) -> Fallible<TypeOpOutput<'tcx, Self>> {         let mut region_constraints = QueryRegionConstraints::default();-        let (output, canonicalized_query, mut obligations, _) =+        let (output, canonicalized_query) =             Q::fully_perform_into(self, infcx, &mut region_constraints)?; -        // Typically, instantiating NLL query results does not-        // create obligations. However, in some cases there-        // are unresolved type variables, and unify them *can*-        // create obligations. In that case, we have to go-        // fulfill them. We do this via a (recursive) query.-        while !obligations.is_empty() {-            trace!("{:#?}", obligations);-            let mut progress = false;-            for obligation in std::mem::take(&mut obligations) {

trying this out in https://github.com/rust-lang/rust/pull/93007

matthiaskrgr

comment created time in 16 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Allocate one vec, instead of one per invocation

@bors try @rust-timer queue

oli-obk

comment created time in 16 hours

create barncholi-obk/rust

branch : alloc_madness

created branch time in 16 hours

PR opened rust-lang/rust

Allocate one vec, instead of one per invocation

potential alternative to https://github.com/rust-lang/rust/pull/92928

r? @ghost

+20 -18

0 comment

2 changed files

pr created time in 16 hours

pull request commentrust-lang/rust

Suppress errors in const eval during trait selection v2

Does incr-unchanged just correspond to another cargo build call after a previous successful compilation and no further changes?

I would think so, yes

I assume that incr-full is just a new build from scratch with incremental on and full is a new build without incremental?!

yes, that's exactly what it is.

The regression is mostly due to the storing of the results in dedup_const_map and the fact that this is a small program in which the evaluation of the constants makes up a large part of the running time.

That's ok imo, We just need to know why there are new queries called, when this PR should only be reducing query calls. As long as we can justify the perf regression, I think we're good, but right now I don't see how that is happening from just the source changes.

b-naber

comment created time in 17 hours

Pull request review commentrust-lang/rust

Suppress errors in const eval during trait selection v2

 impl<'tcx> TyCtxt<'tcx> {     fn set_alloc_id_same_memory(self, id: AllocId, mem: &'tcx Allocation) {         self.alloc_map.lock().alloc_map.insert_same(id, GlobalAlloc::Memory(mem));     }++    /// Store the result of a call to `eval_to_allocation_raw` in order to+    /// allow deduplication.+    #[instrument(skip(self), level = "debug")]+    pub fn save_alloc_for_dedup(self, id: GlobalId<'tcx>, val: ConstDedupResult<ConstAlloc<'tcx>>) {+        let dedup_const_map = self.dedup_const_map.lock();+        dedup_const_map.insert_alloc(id, val);+        debug!("dedup_const_map after insert: {:#?}", dedup_const_map);+    }++    /// Store the result of a call to `eval_to_const_value_raw` in order to deduplicate it.+    #[instrument(skip(self), level = "debug")]+    pub fn save_const_value_for_dedup(+        self,+        id: GlobalId<'tcx>,+        val: ConstDedupResult<ConstValue<'tcx>>,+    ) {+        let dedup_const_map = self.dedup_const_map.lock();+        dedup_const_map.insert_const_val(id, val);+        debug!("dedup_const_map after insert: {:#?}", dedup_const_map);+    }++    /// Tries to deduplicate a call to `eval_to_allocation_raw`. If deduplication isn't+    /// successful `eval_to_allocation_raw` query is executed.+    #[instrument(skip(self, opt_span), level = "debug")]+    pub fn dedup_eval_alloc_raw(

these two functions are almost the same... do you think it would be convoluted to put their bodies into a separate generic function that takes two closures, one for the query and one for the dedup map lookup?

b-naber

comment created time in 17 hours

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Suppress errors in const eval during trait selection v2

 impl<'tcx> TyCtxt<'tcx> {     fn set_alloc_id_same_memory(self, id: AllocId, mem: &'tcx Allocation) {         self.alloc_map.lock().alloc_map.insert_same(id, GlobalAlloc::Memory(mem));     }++    /// Store the result of a call to `eval_to_allocation_raw` in order to+    /// allow deduplication.+    #[instrument(skip(self), level = "debug")]+    pub fn save_alloc_for_dedup(self, id: GlobalId<'tcx>, val: ConstDedupResult<ConstAlloc<'tcx>>) {+        let dedup_const_map = self.dedup_const_map.lock();+        dedup_const_map.insert_alloc(id, val);+        debug!("dedup_const_map after insert: {:#?}", dedup_const_map);+    }++    /// Store the result of a call to `eval_to_const_value_raw` in order to deduplicate it.+    #[instrument(skip(self), level = "debug")]+    pub fn save_const_value_for_dedup(+        self,+        id: GlobalId<'tcx>,+        val: ConstDedupResult<ConstValue<'tcx>>,+    ) {+        let dedup_const_map = self.dedup_const_map.lock();+        dedup_const_map.insert_const_val(id, val);+        debug!("dedup_const_map after insert: {:#?}", dedup_const_map);+    }++    /// Tries to deduplicate a call to `eval_to_allocation_raw`. If deduplication isn't+    /// successful `eval_to_allocation_raw` query is executed.+    #[instrument(skip(self, opt_span), level = "debug")]+    pub fn dedup_eval_alloc_raw(+        self,+        key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,+        opt_span: Option<Span>,+    ) -> EvalToAllocationRawResult<'tcx> {+        use ConstDedupResult::*;++        let (param_env, id) = key.into_parts();+        let dedup_const_map = self.dedup_const_map.lock();+        debug!("dedup_const_map: {:#?}", dedup_const_map);+        let alloc_map = dedup_const_map.alloc_map.borrow();+        debug!("alloc_map: {:#?}", alloc_map);++        let dedup_result = alloc_map.get(&id);+        debug!(?dedup_result);++        match param_env.reveal() {

👍 please copy this comment into the source, it explains this perfectly

b-naber

comment created time in 17 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

allow eq constraints on associated constants

A small regression is to be expected, as crates using lots of associated types (e.g. diesel) will now always go through a match on Term instead of immediately accessing the type.

r=me after a rebase

JulianKnodt

comment created time in 20 hours

issue commentrust-lang/rust

[tracking issue] raw ptr to usize cast inside constants

I'm not sure about the second example either.... how can it be 32 bit if it's supposed to be the address of a static item which may be anywhere in the 64 bit space of the x86_64 machine.

oli-obk

comment created time in 2 days

pull request commentrust-lang/rust

allow eq constraints on associated constants

@bors try @rust-timer queue

JulianKnodt

comment created time in 3 days

pull request commentrust-lang/rust

allow eq constraints on associated constants

@bors r- potentially perf sensitive

JulianKnodt

comment created time in 3 days

pull request commentrust-lang/rust

allow eq constraints on associated constants

@bors r+

JulianKnodt

comment created time in 3 days

Pull request review commentrust-lang/rust

allow eq constraints on associated constants

+#![feature(associated_const_equality)]++pub trait Foo {+  const N: usize;+}++pub struct Bar;++impl Foo for Bar {+  const N: usize = 3;+}++const TEST:usize = 3;+++fn foo<F: Foo<N=3>>() {}+//~^ ERROR associated const equality is incomplete

Ah no, that's fine. As long as you know why it's happening, I'm happy ^^

JulianKnodt

comment created time in 3 days

PullRequestReviewEvent

pull request commentrust-lang/rust

Improve selection errors for `~const` trait bounds

Good enough for now ^^

r=me with the Option::filter nit

fee1-dead

comment created time in 3 days

Pull request review commentrust-lang/rust

Improve selection errors for `~const` trait bounds

-error[E0277]: cannot add `NonConstAdd` to `NonConstAdd`+error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied

Hmm.. I was hoping we could patch rustc_on_unimplemented to just append this, but I forgot that the messages are entirely custom and could make the wording weird or nonsensical.

So... a required field for rustc_on_unimplemented with an append snippet or just an entirely new message?

fee1-dead

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

allow eq constraints on associated constants

+#![feature(associated_const_equality)]++pub trait Foo {+  const N: usize;+}++pub struct Bar;++impl Foo for Bar {+  const N: usize = 3;+}++const TEST:usize = 3;+++fn foo<F: Foo<N=3>>() {}+//~^ ERROR associated const equality is incomplete

Why is the test still erroring?

JulianKnodt

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentrust-lang/rust

Improve selection errors for `~const` trait bounds

-error[E0277]: cannot add `NonConstAdd` to `NonConstAdd`+error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied

Would it be possible to keep the previous message and just append in const contexts. The trait bound message appears again below anyway, so that would seem easier to read by humans

fee1-dead

comment created time in 4 days

Pull request review commentrust-lang/rust

Improve selection errors for `~const` trait bounds

 impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {                             span,                             E0277,                             "{}",-                            message.unwrap_or_else(|| format!(-                                "the trait bound `{}` is not satisfied{}",-                                trait_ref.without_const().to_predicate(tcx),-                                post_message,-                            ))+                            (!predicate_is_const).then(|| message).flatten().unwrap_or_else(

Does message.filter(predicate_is_const) do the same thing?

fee1-dead

comment created time in 4 days

PullRequestReviewEvent
more