jiebi/CodeConvo huggingface dataset:
Change:
The full repo is here: : </p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
For what it's worth, I can reproduce this issue with version 1.63.0, but it doesn't happen with 1.64.0 nor with the latest stable version 1.66.0.
The ICE disappeared in nightly-2022-07-01, which contains the following merges: [x] : ICEs [x] : ICEs [x] : ICEs [x] : ICEs [ ] [x] : ICEs
Here is it minified, and standalone-ed:
Triage: This has been fixed on the latest nightly, as reported, and needs a test to close.
claim

Discussion:
<ins> // edition:2018 use std::{future::Future, marker::PhantomData}; fn spawn<T>(future: T) -> PhantomData<T::Output> where T: Future, { loop {} } #[derive(Debug)] struct IncomingServer {} impl IncomingServer { async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> { //~^ ERROR expected type, found variant `Ok` [E0573] loop {} } async fn spawn(&self, request_handler: impl Sized) { async move { spawn(Self::connection_handler(&request_handler)); }; } } fn main() {} </ins>

<ins> error[E0573]: expected type, found variant `Ok` --> $DIR/issue-106062.rs:15:64 | LL |     async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> { |                                                                ^^ not a type | help: try using the variant's enum | LL |     async fn connection_handler(handler: impl Sized) -> Result<core::result::Result, std::io::Error> { |                                                                ~~~~~~~~~~~~~~~~~~~~ LL |     async fn connection_handler(handler: impl Sized) -> Result<std::result::Result, std::io::Error> { |                                                                ~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error For more information about this error, try `rustc --explain E0573`. </ins>
Change:
Given the following code: The current output is: Ideally the output should not suggest placing before in because the keyword is not valid in that position. Thank you to for finding the minimum reproducible that I used for this issue. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim

Discussion:
let label = "add `dyn` keyword before this trait"; let mut diag = rustc_errors::struct_span_err!(tcx.sess, self_ty.span, E0782, "{}", msg); <del> diag.multipart_suggestion_verbose(label, sugg, Applicability::MachineApplicable); </del> <ins> if self_ty.span.can_be_used_for_suggestions() { diag.multipart_suggestion_verbose( label, sugg, Applicability::MachineApplicable, ); } </ins> // check if the impl trait that we are considering is a impl of a local trait self.maybe_lint_blanket_trait_impl(&self_ty, &mut diag); diag.emit();

<ins> #[derive(Clone)] //~  trait objects must include the `dyn` keyword //~| trait objects must include the `dyn` keyword struct Foo; trait Foo {} //~ the name `Foo` is defined multiple times fn main() {} </ins>

<ins> error[E0428]: the name `Foo` is defined multiple times --> $DIR/issue-106072.rs:4:1 | LL | struct Foo; | ----------- previous definition of the type `Foo` here LL | trait Foo {} | ^^^^^^^^^ `Foo` redefined here | = note: `Foo` must be defined only once in the type namespace of this module error[E0782]: trait objects must include the `dyn` keyword --> $DIR/issue-106072.rs:1:10 | LL | #[derive(Clone)] |          ^^^^^ | = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0782]: trait objects must include the `dyn` keyword --> $DIR/issue-106072.rs:1:10 | LL | #[derive(Clone)] |          ^^^^^ | = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors Some errors have detailed explanations: E0428, E0782. For more information about an error, try `rustc --explain E0428`. </ins>
Change:
When there was a change in a or other non-rust file, bootstrap tries to format it, which makes rustfmt very sad. cc and who broke this in <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I think we just need to filter .rs files before passing them to rustfmt.
This will probably be hit a lot by contributors so I'll pin it for better visibility.
claim
Normally, the walker already filters for files, per Maybe the crate docs are not fully up to date, or I didn't understand them correctly.
The workaround is to run (notice the dot at the end of the command).
I think if we add it like this: will always not ignore it anymore.
Maybe try to put the part I before the ignore part, maybe this makes the ignore list work again? The thing that intrigues me the most is the fact that the files are not ignored later by the file type filter.
For any Rust files we changed locally, our current solution will try to format it, in some scenarios we may not want to format it, such as some files in UI?
Seems right, my current fix is not completed.
I think since you explicitly add the files to , that overrides the types filter.
from my local experiment, seems is still expected, I changed some files which ignored in , they are actually not sent to formatter:
WG-prioritization assigning priority (). label -I-prioritize +P-high

Discussion:
t!(std::fs::write(stamp_file, version)) } <del> /// Returns the files modified between the `merge-base` of HEAD and </del> <ins> /// Returns the Rust files modified between the `merge-base` of HEAD and </ins> /// rust-lang/master and what is now on the disk. /// /// Returns `None` if all files should be formatted. <del> fn get_modified_files(build: &Builder<'_>) -> Option<Vec<String>> { </del> <ins> fn get_modified_rs_files(build: &Builder<'_>) -> Option<Vec<String>> { </ins> let Ok(remote) = get_rust_lang_rust_remote() else {return None;}; if !verify_rustfmt_version(build) { return None;

) .lines() .map(|s| s.trim().to_owned()) <ins> .filter(|f| Path::new(f).extension().map_or(false, |ext| ext == "rs")) </ins> .collect(), ) }

ignore_fmt.add(&format!("!/{}", untracked_path)).expect(&untracked_path); } if !check && paths.is_empty() { <del> if let Some(files) = get_modified_files(build) { </del> <ins> if let Some(files) = get_modified_rs_files(build) { </ins> for file in files { println!("formatting modified file {file}"); ignore_fmt.add(&format!("/{file}")).expect(&file);
Change:
The implementation produces worse code than the equivalent C++ code (, ) The resulting assembly should load and compare a single u64: The assembly loads and compares each u8 individually: <!-- 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. --:
With more aggressive compilation flags I am seeing (latest Nightly):
What flags did you use?
-O -Z mir-opt-level=4
Looks like the first two comparisons gets flattened into one block, and that prevents detection of the whole pattern.
(enabled at ) is the MIR opt which merges the short-circuiting failure paths into 1, and allows to reduce this to a pattern which can be turned into a memcmp.
might improve this. I noticed in it's doing dances: which might be no longer needed once it's and it can thus just compare them both directly. There's also something going on here related to the short-circuiting that I don't understand. If I change it to Then it optimizes as expected 's definitely marked either way, so LLVM ought to be able to move the loads early either way.
Short-circuiting is relevant in that moving everything into one block is generally non-profitable. There is a special pass that detects this pattern (MergeICmps) and converts it into memcmp/bcmp, which is then later expanded into a target-specific efficient comparison sequence. This is a backend IR pass, so you don't see it in output. However, it requires a pretty specific pattern, and does not handle the case where the control flow has been partially flattened and one pair of comparisons uses a select rather than a branch. Your X86 example adds insult to injury by actually vectorizing those two i8 comparisons: That looks pretty clearly non-profitable: Edit: Filed for the SLPVectorizer issue.
I suppose this opt would be specifically enabled by our optimization semantics allowing spurious reads. No change since the add, though. The pass may be affected by being accepted.
Looks like this is fixed now, we should have a test for this if we don't already

Discussion:
<ins> // Regression test for #106269 //@ assembly-output: emit-asm //@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel //@ only-x86_64 //@ ignore-sgx pub struct S { a: u8, b: u8, c: u8, d: u8, } // CHECK-LABEL: manual_eq: #[no_mangle] pub fn manual_eq(s1: &S, s2: &S) -> bool { // CHECK: mov [[REG:[a-z0-9]+]], dword ptr [{{[a-z0-9]+}}] // CHECK-NEXT: cmp [[REG]], dword ptr [{{[a-z0-9]+}}] // CHECK-NEXT: sete al // CHECK: ret s1.a == s2.a && s1.b == s2.b && s1.c == s2.c && s1.d == s2.d } </ins>
Change:
I am trying to extend ByteOrder + Seek, and I have two traits, right now. The first is just extending ByteOrder, and the second extends ByteOrder + Seek For some reason, I get this error when compiling, and it only occurs on the line with readbytes. There are two ways I can work around this, for now. One is by copying the method into the other trait, which I don't really wanna do, or I found this goofy code will also work... Hopefully this helps clue you in on what is going on. Is this a bug with the borrow checker? <!-- 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<summaryBacktrace</summary<p</p</details
I tried reproducing your issue in and this is the error I got: It doesn't complain about mutability though, but rather about a bound (which is implied in the implementation of but not in the one of . The diagnostic also suggests a way to fix the issue, with other alternatives being adding a supertrait to or a constraint to , although both seem non-ideal.
The underlying issue is . The cleanest solution is changing your blanket impl to , propagating up the bound from and label +A-diagnostics
That does fix it, yea. I only have to add ?Sized to the first trait. Should I add it to all of these traits, or I will encounter this again? I am new to rust, and still not entirely sure what this means, or what it means for my trait. Thanks!

Discussion:
} else { err.span_help(source_info.span, "try removing `&mut` here"); } <del> } else if decl.mutability == Mutability::Not && !matches!( </del> <ins> } else if decl.mutability == Mutability::Not { if matches!( </ins> decl.local_info, Some(box LocalInfo::User(ClearCrossCrate::Set(BindingForm::ImplicitSelf( hir::ImplicitSelfKind::MutRef <del> )))) ) { err.span_suggestion_verbose( decl.source_info.span.shrink_to_lo(), "consider making the binding mutable", "mut ", Applicability::MachineApplicable, ); </del> <ins> ),))) ) { err.note( "as `Self` may be unsized, this call attempts to take `&mut &mut self`", ); err.note("however, `&mut self` expands to `self: &mut Self`, therefore `self` cannot be borrowed mutably"); } else { err.span_suggestion_verbose( decl.source_info.span.shrink_to_lo(), "consider making the binding mutable", "mut ", Applicability::MachineApplicable, ); }; </ins> } }

<ins> trait Modify { fn modify(&mut self) ; } impl<T> Modify for T  { fn modify(&mut self)  {} } trait Foo { fn mute(&mut self) { self.modify(); //~ ERROR cannot borrow `self` as mutable } } fn main() {} </ins>

<ins> error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-93078.rs:11:9 | LL |         self.modify(); |         ^^^^^^^^^^^^^ cannot borrow as mutable | = note: as `Self` may be unsized, this call attempts to take `&mut &mut self` = note: however, `&mut self` expands to `self: &mut Self`, therefore `self` cannot be borrowed mutably error: aborting due to previous error For more information about this error, try `rustc --explain E0596`. </ins>
Change:
https://crater- https://crater- https://crater- https://crater- cc as possible root cause,
WG-prioritization assigning priority (). label -I-prioritize +P-critical

Discussion:
// Fresh lifetimes in APIT used to be allowed in async fns and forbidden in // regular fns. if let Some(hir::PredicateOrigin::ImplTrait) = where_bound_origin <del> && let hir::LifetimeName::Param(_) = lifetime_ref.res && lifetime_ref.is_anonymous() </del> <ins> && let hir::LifetimeName::Param(param_id) = lifetime_ref.res && let Some(generics) = self.tcx.hir().get_generics(self.tcx.local_parent(param_id)) && let Some(param) = generics.params.iter().find(|p| p.def_id == param_id) && param.is_elided_lifetime() </ins> && let hir::IsAsync::NotAsync = self.tcx.asyncness(lifetime_ref.hir_id.owner.def_id) && !self.tcx.features().anonymous_lifetime_in_impl_trait {

//~| ERROR missing lifetime specifier } <ins> // This must not err, as the `&` actually resolves to `'a`. fn resolved_anonymous<'a, T>(f: impl Fn(&'a str) -> &T) { f("f") } </ins> fn main() {}
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. --<!-- 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<strongBacktrace</strong</summary<p</p</details
label +F-dyn_star
:laughing: the code thinks that this is a upcast, I think, rather than an unsize coercion. shouldn't be too hard to fix, but I may leave it for someone else. edit: nvm I'll just fix it.

Discussion:
( &ty::Dynamic(ref data_a, _, src_dyn_kind), &ty::Dynamic(ref data_b, _, target_dyn_kind), <del> ) => { assert_eq!(src_dyn_kind, target_dyn_kind); </del> <ins> ) if src_dyn_kind == target_dyn_kind => { </ins> let old_info = old_info.expect("unsized_info: missing old info for trait upcasting coercion"); if data_a.principal_def_id() == data_b.principal_def_id() {

<ins> // build-pass #![feature(dyn_star)] //~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes fn main() { let x: dyn* Send = &(); let x = Box::new(x) as Box<dyn Send>; } </ins>

<ins> warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/dyn-star-to-dyn.rs:3:12 | LL | #![feature(dyn_star)] |            ^^^^^^^^ | = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted </ins>
Change:
Docs (and specially intra-doc-links) are easy to get wrong and rarely tested locally, causing many rollups to fail. We should check them in CI as well to catch mistakes early. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
But already runs in PR CI
cc maybe linkchecker is missing some cases?
The most recent case I've seen was this: where broken docs broke a try build while PR CI was green (that wasn't an intra doc link though but still docs)
Ah ok, this is specifically about rustdoc warnings, not broken links. That's definitely doable to do, we can shove into mingw-check :) it doesn't need to build the compiler at all, only check it.
Apparently doesn't actually build the compiler docs (or tool docs) when the flag isn't set in . I don't know if this is a bug or a feature, but we could just set the flag for CI here:
Apparently doesn't actually build the compiler docs (or tool docs) when the flag isn't set in . I don't know if this is a bug or a feature, but we could just set the flag for CI here:

Discussion:
python3 ../x.py test --stage 0 src/tools/compiletest &&  python3 ../x.py test --stage 0 core alloc std test proc_macro &&  # Build both public and internal documentation. <ins> RUSTDOCFLAGS="--document-private-items --document-hidden-items" python3 ../x.py doc --stage 0 compiler &&  </ins> RUSTDOCFLAGS="--document-private-items --document-hidden-items" python3 ../x.py doc --stage 0 library/test &&  /scripts/validate-toolstate.sh &&  /scripts/validate-error-codes.sh &&
Change:
A PR modifying an existing test now has a merge conflict e.g. but a PR adding a new test doesn't e.g. , and I'm worried if a new test is to by accident. Originally posted by in <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Mentoring instructions: Add a new module to src/tools/tidy, then call the check from See the surrounding code for examples of how tidy checks work.
I am confused as to why this was not a blocker for moving the tests
"I didn't think of it"
claim

Discussion:
pub mod primitive_docs; pub mod style; pub mod target_specific_tests; <ins> pub mod tests_placement; </ins> pub mod ui_tests; pub mod unit_tests; pub mod unstable_book;

check!(extdeps, &root_path); // Checks over tests. <ins> check!(tests_placement, &root_path); </ins> check!(debug_artifacts, &tests_path); check!(ui_tests, &tests_path); check!(mir_opt_tests, &tests_path, bless);

<ins> use std::path::Path; const FORBIDDEN_PATH: &str = "src/test"; const ALLOWED_PATH: &str = "tests"; pub fn check(root_path: impl AsRef<Path>, bad: &mut bool) { if root_path.as_ref().join(FORBIDDEN_PATH).exists() { tidy_error!( bad, "Tests have been moved, please move them from {} to {}", root_path.as_ref().join(FORBIDDEN_PATH).display(), root_path.as_ref().join(ALLOWED_PATH).display() ) } } </ins>
Change:
Originally posted by in <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --This issue has been assigned to via . <!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
Done in I believe
assign

Discussion:
) -> Result<(), SendTimeoutError<T>> { let token = &mut Token::default(); loop { <del> // Try sending a message several times. let backoff = Backoff::new(); loop { if self.start_send(token) { let res = unsafe { self.write(token, msg) }; return res.map_err(SendTimeoutError::Disconnected); } if backoff.is_completed() { break; } else { backoff.spin_light(); } </del> <ins> // Try sending a message. if self.start_send(token) { let res = unsafe { self.write(token, msg) }; return res.map_err(SendTimeoutError::Disconnected); </ins> } if let Some(d) = deadline {

pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTimeoutError> { let token = &mut Token::default(); loop { <ins> // Try receiving a message. </ins> if self.start_recv(token) { let res = unsafe { self.read(token) }; return res.map_err(|_| RecvTimeoutError::Disconnected);

/// Backs off using lightweight spinning. /// <del> /// This method should be used for: ///     - Retrying an operation because another thread made progress. i.e. on CAS failure. ///     - Waiting for an operation to complete by spinning optimistically for a few iterations ///     before falling back to parking the thread (see `Backoff::is_completed`). </del> <ins> /// This method should be used for retrying an operation because another thread made /// progress. i.e. on CAS failure. </ins> #[inline] pub fn spin_light(&self) { let step = self.step.get().min(SPIN_LIMIT);

self.step.set(self.step.get() + 1); } <del> /// Returns `true` if quadratic backoff has completed and parking the thread is advised. #[inline] pub fn is_completed(&self) -> bool { self.step.get() > SPIN_LIMIT } </del> }
Change:
The false negative bisects to , so pretty obviously . FYI From skimming , that's an issue about const generics. It doesn't seem like the PR was supposed to have affected unused_braces situations outside of const generics position.

Discussion:
//      ``` // - the block has no attribute and was not created inside a macro // - if the block is an `anon_const`, the inner expr must be a literal <del> //      (do not lint `struct A<const N: usize>; let _: A<{ 2 + 3 }>;`) // </del> <ins> //   not created by a macro, i.e. do not lint on: //      ``` //      struct A<const N: usize>; //      let _: A<{ 2 + 3 }>; //      let _: A<{produces_literal!()}>; //      ``` </ins> // FIXME(const_generics): handle paths when #67075 is fixed. if let [stmt] = inner.stmts.as_slice() { if let ast::StmtKind::Expr(ref expr) = stmt.kind { if !Self::is_expr_delims_necessary(expr, followed_by_block, false) && (ctx != UnusedDelimsCtx::AnonConst <del> || matches!(expr.kind, ast::ExprKind::Lit(_))) </del> <ins> || (matches!(expr.kind, ast::ExprKind::Lit(_)) && !expr.span.from_expansion())) </ins> && !cx.sess().source_map().is_multiline(value.span) && value.attrs.is_empty() <del> && !expr.span.from_expansion() </del> && !value.span.from_expansion() && !inner.span.from_expansion() {

if { return } { } <ins> // regression test for https://github.com/rust-lang/rust/issues/106899 return println!("!"); //~^ WARN unnecessary braces </ins> }

if { return } { } <ins> // regression test for https://github.com/rust-lang/rust/issues/106899 return { println!("!") }; //~^ WARN unnecessary braces </ins> }

LL +     consume(7); | <del> warning: 5 warnings emitted </del> <ins> warning: unnecessary braces around `return` value --> $DIR/unused_braces.rs:55:12 | LL |     return { println!("!") }; |            ^^             ^^ | help: remove these braces | LL -     return { println!("!") }; LL +     return println!("!"); | warning: 6 warnings emitted </ins>