jiebi/CodeConvo huggingface dataset:
Change:
Reporting this here after asking in IRC something like this: where c_callback is called from a thread created by the c library crashes the application after a while with: previously SharedChan seemed to work without problem
cc It looks like the new can no longer be used outside a runtime?
Whoops, testing a fix now (sorry about that!)
thanks!
sorry to post on a closed issue, but i'm finding the same problem now in SyncChan/SyncPort not sure if it's a real bug or in this case it's supposed to work like that?
You won't be able to use those off the runtime because a send involves then receiving which blocks the task. You're only able to block if you have a local rust task available.
that's what i was suspecting, thanks!

Discussion:
pub fn try_send(&self, t: T) -> bool { // In order to prevent starvation of other tasks in situations where // a task sends repeatedly without ever receiving, we occassionally <del> // yield instead of doing a send immediately.  Only doing this if // we're doing a rescheduling send, otherwise the caller is // expecting not to context switch. </del> <ins> // yield instead of doing a send immediately. </ins> // <del> // Note that we don't unconditionally attempt to yield because the // TLS overhead can be a bit much. </del> <ins> // Don't unconditionally attempt to yield because the TLS overhead can // be a bit much, and also use `try_take` instead of `take` because // there's no reason that this send shouldn't be usable off the // runtime. </ins> let cnt = self.sends.get() + 1; self.sends.set(cnt); if cnt % (RESCHED_FREQ as uint) == 0 { <del> let task: ~Task = Local::take(); task.maybe_yield(); </del> <ins> let task: Option<~Task> = Local::try_take(); task.map(|t| t.maybe_yield()); </ins> } let (new_inner, ret) = match self.inner {

pub fn try_recv(&self) -> TryRecvResult<T> { // If a thread is spinning in try_recv, we should take the opportunity // to reschedule things occasionally. See notes above in scheduling on <del> // sends for why this doesn't always hit TLS. </del> <ins> // sends for why this doesn't always hit TLS, and also for why this uses // `try_take` instead of `take`. </ins> let cnt = self.receives.get() + 1; self.receives.set(cnt); if cnt % (RESCHED_FREQ as uint) == 0 { <del> let task: ~Task = Local::take(); task.maybe_yield(); </del> <ins> let task: Option<~Task> = Local::try_take(); task.map(|t| t.maybe_yield()); </ins> } loop {

// wait for the child task to exit before we exit p1.recv(); }) <ins> test!(fn sends_off_the_runtime() { use rt::thread::Thread; let (p, c) = Chan::new(); let t = Thread::start(proc() { for _ in range(0, 1000) { c.send(()); } }); for _ in range(0, 1000) { p.recv(); } t.join(); }) test!(fn try_recvs_off_the_runtime() { use rt::thread::Thread; let (p, c) = Chan::new(); let (pdone, cdone) = Chan::new(); let t = Thread::start(proc() { let mut hits = 0; while hits < 10 { match p.try_recv() { Data(()) => { hits += 1; } Empty => { Thread::yield_now(); } Disconnected => return, } } cdone.send(()); }); for _ in range(0, 10) { c.send(()); } t.join(); pdone.recv(); }) </ins> }
Change:
We have some relative links in doc, e.g., the link of in the comments for : but we will get the page if we click it in , which is re-exported. So I think we can fix this by two ways: 't use relative path in rustc doc 't generate new link for re-exported items, use the same links with the original definition but for the second option, we may have private middle mods, so it may be not a solution. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
cc
I'm thinking of tackling this issue, is this Issue aimed at removing this invalid path once and for all? (Sorry if I'm wrong as I'm trying to contribute for the first time)
claim
Hi just checking if you are still working on the issue? If so, apologies please ignore this. Otherwise I'm happy to take over. Thanks
take it

Discussion:
#[cfg(test)] mod tests; <ins> #[doc(no_inline)] </ins> pub use hir::*; pub use hir_id::*; pub use lang_items::{LangItem, LanguageItems};

pub use idx::Idx; pub use rustc_index_macros::newtype_index; pub use slice::IndexSlice; <ins> #[doc(no_inline)] </ins> pub use vec::IndexVec; /// Type size assertion. The first argument is a type and the second argument is its expected size.
Change:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: SizeSkeleton::compute(&Other): layout errored (Unknown(Alias(Projection, AliasTy { args: [Other], defid: DefId(2:2049 ~ core[a6f4]::ptr::metadata::Pointee::Metadata) }))), yet tail is not a type parameter or a projection', 'error: internal compiler error: SizeSkeleton::compute(&Other): layout errored (Unknown(Alias(Projection, AliasTy { args: [Other], defid: DefId(2:2049 ~ core[a6f4]::ptr::metadata::Pointee::Metadata) }))), yet tail is not a type parameter or a projection' File: --auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [typeck] type-checking [analysis] running analysis passes on this crate --<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
that's true, it's a type error (should be a quick fix)
you may also enjoy this gem: (found somewhere else)
Ah, this ( ) one bisects to fyi ^^
claim

Discussion:
debug_assert!(tail.has_non_region_param()); Ok(SizeSkeleton::Pointer { non_zero, tail: tcx.erase_regions(tail) }) } <ins> ty::Error(guar) => { // Fixes ICE #124031 return Err(tcx.arena.alloc(LayoutError::ReferencesError(*guar))); } </ins> _ => bug!( "SizeSkeleton::compute({ty}): layout errored ({err:?}), yet  tail `{tail}` is not a type parameter or a projection",

<del> //@ known-bug: #124031 trait Trait { type RefTarget; } impl Trait for () {} struct Other { data: <() as Trait>::RefTarget, } fn main() { unsafe { std::mem::transmute::<Option<()>, Option<&Other>>(None); } } </del>

<ins> // Regression test for issue #124031 // Checks that we don't ICE when the tail // of an ADT has a type error trait Trait { type RefTarget; } impl Trait for () {} //~^ ERROR not all trait items implemented, missing: `RefTarget` struct Other { data: <() as Trait>::RefTarget, } fn main() { unsafe { std::mem::transmute::<Option<()>, Option<&Other>>(None); } } </ins>

<ins> error[E0046]: not all trait items implemented, missing: `RefTarget` --> $DIR/ice-type-error-in-tail-124031.rs:9:1 | LL |     type RefTarget; |     -------------- `RefTarget` from trait ... LL | impl Trait for () {} | ^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0046`. </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --Just the sample code from the leptos : <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongFull Backtrace</strong</summary<p </p</details
I'm also hitting this on 2024-04-16 but not on 2024-04-14
Glad I checked to see if this had been raised before I posted a duplicate Same issues with leptos start trunk Just grabbed ran through rustup toolchain install nightly --allow-downgrade rustup target add wasm32-unknown-unknown excitedly hit trunk serve --port 3000 --open and watched the compiler detonate around 6 times a second dumping stack traces into the project directory.
is this still not solved? because I also experienced this when running the command
I'm pretty sure that's from cc
Is there still an issue here? I still can't run
This is a compiler issue, it won't be fixed before the next nightly release, please stick with an older compiler until lands
what i have to do to change to older compiler version?
Unless this is leptos' doing, in the folder where you are seeing the problem

Discussion:
// a test for it. (_, ty::Infer(ty::TyVar(_))) => {} (ty::Infer(ty::TyVar(_)), _) => {} <del> _ if (r_a, r_b).has_opaque_types() => { </del> <ins> _ if r_a != r_b && (r_a, r_b).has_opaque_types() => { </ins> span_bug!( cause.span(), "opaque types got hidden types registered from within subtype predicate: {r_a:?} vs {r_b:?}"
Change:
The library is currently not registered/configured in bootstrap to be able to run its unit tests via . See for an example on how compiletest unit tests are ran. I plan to get to this eventually (busy ATM), but if someone wants to try implementing this feel free to claim it. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
Thanks, I'm doing this. claim

Discussion:
run.builder.ensure(RunMakeSupport { compiler, target: run.build_triple() }); } <ins> /// Builds run-make-support and returns the path to the resulting rlib. </ins> fn run(self, builder: &Builder<'_>) -> PathBuf { builder.ensure(compile::Std::new(self.compiler, self.target));

} } <ins> #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct CrateRunMakeSupport { host: TargetSelection, } impl Step for CrateRunMakeSupport { type Output = (); const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/run-make-support") } fn make_run(run: RunConfig<'_>) { run.builder.ensure(CrateRunMakeSupport { host: run.target }); } /// Runs `cargo test` for run-make-support. fn run(self, builder: &Builder<'_>) { let host = self.host; let compiler = builder.compiler(builder.top_stage, host); builder.ensure(compile::Std::new(compiler, host)); let mut cargo = tool::prepare_tool_cargo( builder, compiler, Mode::ToolStd, host, "test", "src/tools/run-make-support", SourceType::InTree, &[], ); cargo.allow_features("test"); run_cargo_test( cargo, &[], &[], "run-make-support", "run-make-support self test", compiler, host, builder, ); } } </ins> default_test!(Ui { path: "tests/ui", mode: "ui", suite: "ui" }); default_test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes" });

test::Clippy, test::RustDemangler, test::CompiletestTest, <ins> test::CrateRunMakeSupport, </ins> test::RustdocJSStd, test::RustdocJSNotStd, test::RustdocGUI,
Change:
At , acquire a pointer of type from a shared reference , and subsequently, in the , we reinterpret as and use it as a mutable pointer At the method of the field requires as defined in The whole process can be that we use to acquire a and call a mutable method on that variable, which seems problematic.
The code is sound if it uses , and all the fields inside that type is covered by . It should use or instead of pointer-casting.
Edit: I think what I want to ask about is the following example, which is almost identical to the original question and passes miri's check:
No, you should not do that.
So this is what is happening in the standard library: There is a structure like ; In , is converted to and passed to ; In , is converted to , then is called. requires , so it is actually , which means that a is born from a . In the entire process, we haven’t touched on anything related to . And, I also believe that containing an is not a reason for to be treated differently.
Yes, should be and not .
I should clarify that my "should not" here is that it can potentially pass miri, but my understanding is that it is brittle and relying on the operational semantics being a certain way, rather than being a "necessarily true" interpretation of Rust's semantics. Programs which are slight modifications easily become unsound, and libstd unfortunately has slight modifications done to it all the time, so... aiui this code currently passes miri because we do run miri on libstd's tests, but is not what I would consider "durable".
( probably. )

Discussion:
use super::lazy::LazyKeyInner; use crate::cell::Cell; use crate::sys::thread_local_dtor::register_dtor; <del> use crate::{fmt, mem, panic}; </del> <ins> use crate::{fmt, mem, panic, ptr}; </ins> #[doc(hidden)] #[allow_internal_unstable(thread_local_internals, cfg_target_thread_local, thread_local)]

// Wrap the call in a catch to ensure unwinding is caught in the event // a panic takes place in a destructor. if let Err(_) = panic::catch_unwind(panic::AssertUnwindSafe(|| unsafe { <del> let value = (*ptr).inner.take(); (*ptr).dtor_state.set(DtorState::RunningOrHasRun); </del> <ins> let Key { inner, dtor_state } = &*ptr; let value = inner.take(); dtor_state.set(DtorState::RunningOrHasRun); </ins> drop(value); })) { rtabort!("thread local panicked on drop");

} } <del> /// The other methods hand out references while taking &self. /// As such, callers of this method must ensure no `&` and `&mut` are /// available and used at the same time. </del> <ins> /// Watch out: unsynchronized internal mutability! /// /// # Safety /// Causes UB if any reference to the value is used after this. </ins> #[allow(unused)] <del> pub unsafe fn take(&mut self) -> Option<T> { // SAFETY: See doc comment for this method. unsafe { (*self.inner.get()).take() } </del> <ins> pub(crate) unsafe fn take(&self) -> Option<T> { let mutable: *mut _ = UnsafeCell::get(&self.inner); // SAFETY: That's the caller's problem. unsafe { mutable.replace(None) } </ins> } } }
Change:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'no entry found for key'', 'thread 'rustc' panicked at 'no entry found for key'' File: --auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [resolverforlowering_raw] getting the resolver for lowering --
this probably crashes since but I haven't verified that yet
smaller
even smaller

Discussion:
ast::AssocItemKind::Fn(..) => AssocSuggestion::AssocFn { called }, ast::AssocItemKind::Type(..) => AssocSuggestion::AssocType, ast::AssocItemKind::Delegation(..) <del> if self.r.delegation_fn_sigs[&self.r.local_def_id(assoc_item.id)] .has_self => </del> <ins> if self .r .delegation_fn_sigs .get(&self.r.local_def_id(assoc_item.id)) .map_or(false, |sig| sig.has_self) => </ins> { AssocSuggestion::MethodWithSelf { called } }

<del> //@ known-bug: #124342 trait Trait2 : Trait { reuse <() as Trait>::async { (async || {}).await; }; } </del>

<ins> #![feature(fn_delegation)] #![allow(incomplete_features)] mod to_reuse {} trait Trait { reuse to_reuse::foo { foo } //~^ ERROR cannot find function `foo` in module `to_reuse` //~| ERROR cannot find value `foo` in this scope } fn main() {} </ins>

<ins> error[E0425]: cannot find function `foo` in module `to_reuse` --> $DIR/ice-issue-124342.rs:7:21 | LL |     reuse to_reuse::foo { foo } |                     ^^^ not found in `to_reuse` error[E0425]: cannot find value `foo` in this scope --> $DIR/ice-issue-124342.rs:7:27 | LL |     reuse to_reuse::foo { foo } |                           ^^^ | help: you might have meant to refer to the associated function | LL |     reuse to_reuse::foo { Self::foo } |                           ++++++ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>
Change:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'no entry found for key'', 'thread 'rustc' panicked at 'no entry found for key'' File: --auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [hircrate] getting the crate HIR [hirattrs] getting HIR owner attributes in `` [entry_fn] looking up the entry function of a crate [analysis] running analysis passes on this crate --
cc

Discussion:
return false; }; if let Some(local_sig_id) = sig_id.as_local() { <del> self.resolver.delegation_fn_sigs[&local_sig_id].has_self </del> <ins> // The value may be missing due to recursive delegation. // Error will be emmited later during HIR ty lowering. self.resolver.delegation_fn_sigs.get(&local_sig_id).map_or(false, |sig| sig.has_self) </ins> } else { match self.tcx.def_kind(sig_id) { DefKind::Fn => false,

<del> //@ known-bug: #124347 trait Trait: ToReuse { reuse Trait::lolno { &self.0 }; } </del>

<ins> #![feature(fn_delegation)] #![allow(incomplete_features)] trait Trait { reuse Trait::foo { &self.0 } //~^ ERROR recursive delegation is not supported yet } reuse foo; //~^ ERROR recursive delegation is not supported yet fn main() {} </ins>

<ins> error: recursive delegation is not supported yet --> $DIR/ice-issue-124347.rs:5:18 | LL |     reuse Trait::foo { &self.0 } |                  ^^^ callee defined here error: recursive delegation is not supported yet --> $DIR/ice-issue-124347.rs:9:7 | LL | reuse foo; |       ^^^ callee defined here error: aborting due to 2 previous errors </ins>
Change:
I checked out the master branch and ran and the test failed: this was on
I am having the same problem on aarch64-apple-darwin. cc this started with .
I can't reproduce this in a clean ubuntu container. Can you? If not, probably something specific about your environments is causing this? The test did pass bors, after all.
This is also happening in dev-desktop-us-, where would be easy to reproduce I guess.
I think it might be an issue with caching, perhaps of the aux-bins. The following should reliably reproduce it:
If I do this, the test goes from failing to passing: So yeah, looks like a problem with cache invalidation of something in that directory.
Thanks for the reproducer. This fixes it for me: The failure is because there is an old .so file lying around: ./build/x8664-unknown-linux-gnu/test/ui/attributes/unixsigpipe/unixsigpipe- It should use: ./build/x8664-unknown-linux-gnu/test/ui/attributes/unixsigpipe/unixsigpipe- By removing the old and obsolete file, the test passes.

Discussion:
if !self.props.aux_bins.is_empty() { let aux_bin_dir = self.aux_bin_output_dir_name(); <ins> remove_and_create_dir_all(&aux_dir); </ins> remove_and_create_dir_all(&aux_bin_dir); }

extern crate libc; <del> // By default the Rust runtime resets SIGPIPE to SIG_DFL before exec:ing child </del> <ins> // By default the Rust runtime resets SIGPIPE to SIG_DFL before exec'ing child </ins> // processes so opt-out of that with `#[unix_sigpipe = "sig_dfl"]`. See // https://github.com/rust-lang/rust/blob/bf4de3a874753bbee3323081c8b0c133444fed2d/library/std/src/sys/pal/unix/process/process_unix.rs#L359-L384 #[unix_sigpipe = "sig_dfl"]
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --The simplest version uses / however I have also tested this via a sub-crate. : : <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: I can also reproduce this on and on and . When running <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
cc

Discussion:
} if is_diagnostic_namespace_variant { <del> tcx.emit_node_span_lint( UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, tcx.local_def_id_to_hir_id(item_def_id.expect_local()), vec![item.span()], MalformedOnUnimplementedAttrLint::new(item.span()), ); </del> <ins> if let Some(def_id) = item_def_id.as_local() { tcx.emit_node_span_lint( UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, tcx.local_def_id_to_hir_id(def_id), vec![item.span()], MalformedOnUnimplementedAttrLint::new(item.span()), ); } </ins> } else { // nothing found tcx.dcx().emit_err(NoValueInOnUnimplemented { span: item.span() });

<ins> #[diagnostic::on_unimplemented(aa = "broken")] pub trait Test {} </ins>

<ins> //@ edition:2021 //@ compile-flags:--test //@ aux-build:bad_on_unimplemented.rs // Do not ICE when encountering a malformed `#[diagnostic::on_unimplemented]` annotation in a // dependency when incorrectly used (#124651). extern crate bad_on_unimplemented; use bad_on_unimplemented::Test; fn breakage<T: Test>(_: T) {} #[test] fn test() { breakage(1); //~ ERROR E0277 } </ins>

<ins> error[E0277]: the trait bound `{integer}: Test` is not satisfied --> $DIR/on_unimplemented_ice.rs:16:14 | LL |     breakage(1); |     -------- ^ the trait `Test` is not implemented for `{integer}` |     | |     required by a bound introduced by this call | note: required by a bound in `breakage` --> $DIR/on_unimplemented_ice.rs:12:16 | LL | fn breakage<T: Test>(_: T) {} |                ^^^^ required by this bound in `breakage` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. </ins>
Change:
<!-- Thank you for filing a regression report! A regression is something that changed between versions of Rust but was not supposed to. Please provide a short summary of the regression, along with any information you feel is relevant to replicate it. --I tried this code: on stable 1.78.0, this checks in 0.02 seconds. on beta 1.79.0-beta.3, this hangs somewhere in , I killed it after 5 minutes of no progress.
cc
Sharing the stack would be useful
:thinking: that doesn't really seem to be it
You need to switch to like thread 2 or 3 if you're doing this in gdb
it's not particularly deep, but it looks downstream of so I guess this must be it
Minimal:

Discussion:
let x = self.parse_seq_to_before_end( &token::Gt, SeqSep::trailing_allowed(token::Comma), <del> |p| p.parse_generic_arg(None), </del> <ins> |p| match p.parse_generic_arg(None)? { Some(arg) => Ok(arg), // If we didn't eat a generic arg, then we should error. None => p.unexpected_any(), }, </ins> ); match x { Ok((_, _, Recovered::No)) => {

<ins> fn foo() { let x = Tr<A, A:>; //~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,` } fn main() {} </ins>

<ins> error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,` --> $DIR/turbofish-arg-with-stray-colon.rs:2:17 | LL |     let x = Tr<A, A:>; |                 ^ expected one of 8 possible tokens | = note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728> help: maybe write a path separator here | LL |     let x = Tr<A, A::>; |                    ~~ error: aborting due to 1 previous error </ins>