jiebi/CodeConvo huggingface dataset:
Change:
This will take quite a while; sorry, I don't have a more minimal reproduction on hand since the issue doesn't reproduce on a toy example and reducing the actual reproduction into a minimal example is tricky when it takes forever to reproduce. The compilation succeeds. Linking fails. rustc 1.69.0-nightly ( 2023-01-23) rustc 1.69.0-nightly ( 2023-02-13) Linux+amd64 The issue also reproduces on macOS+aarch64. I'm not sure whether this is a generic LTO bug, or a bug with . The  crate sets up a bunch of trampolines like this: <details<summaryRelevant code</summary</detailsSo as you can see the symbol that's being unnecessarily stripped out is being passed into the block () and that is being called from assembly (). That symbol is just a normal mangled extern "C" function (). What's also interesting is also that this seems to affect only these two symbols (there are more that are defined, and it seems like those are not being stripped out for some reason), and that it doesn't reproduce on toy examples. There are also two potential workarounds; first workaround is to just mark the function as : The other is to create a dummy variable with a on it: After applying either of those the linking succeeds even when LTO is enabled. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Might or might not be related:
This is a minimal reproduction that works on macOS and Linux (x86_64). I think the fixes this issue.
label +A-llvm
claim

Discussion:
<ins> include ../tools.mk # Verify that the impl_* symbols are preserved. #108030 # only-x86_64-unknown-linux-gnu # min-llvm-version: 17 all: $(RUSTC) -Cdebuginfo=0 -Copt-level=3 lib.rs $(RUSTC) -Clto=fat -Cdebuginfo=0 -Copt-level=3 main.rs </ins>

<ins> #![crate_type = "rlib"] #![crate_type = "cdylib"] #[macro_export] macro_rules! asm_func { ($name:expr, $body:expr $(, $($args:tt)*)?) => { core::arch::global_asm!( concat!( ".p2align 4n", ".hidden ", $name, "n", ".global ", $name, "n", ".type ", $name, ",@functionn", $name, ":n", $body, ".size ", $name, ",.-", $name, ) $(, $($args)*)? ); }; } macro_rules! libcall_trampoline { ($libcall:ident ; $libcall_impl:ident) => { asm_func!( stringify!($libcall), concat!( " .cfi_startproc simple .cfi_def_cfa_offset 0 jmp {} .cfi_endproc ", ), sym $libcall_impl ); }; } pub mod trampolines { extern "C" { pub fn table_fill_funcref(); pub fn table_fill_externref(); } unsafe extern "C" fn impl_table_fill_funcref() {} unsafe extern "C" fn impl_table_fill_externref() {} libcall_trampoline!(table_fill_funcref ; impl_table_fill_funcref); libcall_trampoline!(table_fill_externref ; impl_table_fill_externref); } </ins>

<ins> extern crate lib; use lib::trampolines::*; fn main() { unsafe { table_fill_externref(); table_fill_funcref(); } } </ins>
Change:
The  crate <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
probably duplicate of
This is some different issue than whitespace issues in , it's not resolved by I'll investigate in more detail in a couple of days.
Fixed in

Discussion:
use std::mem; use thin_vec::ThinVec; <ins> use crate::clean::inline::merge_attrs; </ins> use crate::core::{self, DocContext, ImplTraitParam}; use crate::formats::item_type::ItemType; use crate::visit_ast::Module as DocModule;

_ => unreachable!("not yet converted"), }; <del> let mut extra_attrs = Vec::new(); </del> <ins> let mut import_attrs = Vec::new(); let mut target_attrs = Vec::new(); </ins> if let Some(import_id) = import_id && let Some(hir::Node::Item(use_node)) = cx.tcx.hir().find_by_def_id(import_id) { let is_inline = inline::load_attrs(cx, import_id.to_def_id()).lists(sym::doc).get_word_attr(sym::inline).is_some(); // Then we get all the various imports' attributes. <del> get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut extra_attrs, is_inline); add_without_unwanted_attributes(&mut extra_attrs, inline::load_attrs(cx, def_id), is_inline); </del> <ins> get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut import_attrs, is_inline); add_without_unwanted_attributes(&mut target_attrs, inline::load_attrs(cx, def_id), is_inline); </ins> } else { // We only keep the item's attributes. <del> extra_attrs.extend_from_slice(inline::load_attrs(cx, def_id)); </del> <ins> target_attrs.extend_from_slice(inline::load_attrs(cx, def_id)); </ins> } <del> let attrs = Attributes::from_ast(&extra_attrs); let cfg = extra_attrs.cfg(cx.tcx, &cx.cache.hidden_cfg); </del> <ins> let import_parent = import_id.map(|import_id| cx.tcx.local_parent(import_id).to_def_id()); let (attrs, cfg) =  merge_attrs(cx, import_parent, &target_attrs, Some(&import_attrs)); </ins> let mut item = Item::from_def_id_and_attrs_and_parts(def_id, Some(name), kind, Box::new(attrs), cfg);

<ins> // Import for `A` is inlined and doc comments on the import and `A` itself are merged. // After the merge they still have correct parent scopes to resolve both `[A]` and `[B]`. // check-pass #![allow(rustdoc::private_intra_doc_links)] mod m { /// [B] pub struct A {} pub struct B {} } /// [A] pub use m::A; </ins>
Change:
: <details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
searched nightlies: from nightly-2023-01-01 to nightly-2023-02-15 regressed nightly: nightly-2023-02-07 searched commits: from to regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsOf that rollup, looks most likely responsible to me. cc
claim
Ah, I had assumed that was infallible (at least in this context), but apparently not. So prior to calling this, the function should verify that it has the right kind, and if not, bail out (). Ideally it would resolve the trait alias too, but there's enough existing corner-cases which aren't handled that it isn't a big deal.
Actually, I think the problem arises earlier, when building derived obligations for trait aliases: they shouldn't be s at all. I have a fix, about to push.

Discussion:
// This is the "trait" (meaning, the predicate "proved" by this `impl`) which provides the `Self` type we care about. // For the purposes of this function, we hope that it is a `struct` type, and that our current `expr` is a literal of // that struct type. <del> let impl_trait_self_ref: Option<ty::TraitRef<'tcx>> = self.tcx.impl_trait_ref(obligation.impl_def_id).map(|impl_def| impl_def.skip_binder()); let Some(impl_trait_self_ref) = impl_trait_self_ref else { // It is possible that this is absent. In this case, we make no progress. return Err(expr); </del> <ins> let impl_trait_self_ref = if self.tcx.is_trait_alias(obligation.impl_def_id) { self.tcx.mk_trait_ref( obligation.impl_def_id, ty::InternalSubsts::identity_for_item(self.tcx, obligation.impl_def_id), ) } else { self.tcx .impl_trait_ref(obligation.impl_def_id) .map(|impl_def| impl_def.skip_binder()) // It is possible that this is absent. In this case, we make no progress. .ok_or(expr)? </ins> }; // We only really care about the `Self` type itself, which we extract from the ref.

<ins> // Regression test for #108072: do not ICE upon unmet trait alias constraint #![feature(trait_alias)] trait IteratorAlias = Iterator; fn f(_: impl IteratorAlias) {} fn main() { f(()) //~ `()` is not an iterator } </ins>

<ins> error[E0277]: `()` is not an iterator --> $DIR/issue-108072-unmet-trait-alias-bound.rs:10:7 | LL |     f(()) |     - ^^ `()` is not an iterator |     | |     required by a bound introduced by this call | = help: the trait `Iterator` is not implemented for `()` = note: required for `()` to implement `IteratorAlias` note: required by a bound in `f` --> $DIR/issue-108072-unmet-trait-alias-bound.rs:7:14 | LL | fn f(_: impl IteratorAlias) {} |              ^^^^^^^^^^^^^ required by this bound in `f` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
Change:
I get this error: This patch seems to fix the problem for me:
This should have been fixed by . Are you using an older version of rust?
I'm using a version from a few hours ago, and I've tried clobbering any local state with . The error still happens. :/
What revision are you using?
I am also running into this error on OSX 10.9, on .
This is a 10.9 error. You can work around it by removing -L $(TMPDIR) from However this is likely to break the build on other platforms.
I think it's caused by Clang implicitly including the current directory as a link argument. Since there is no gcc on 10.9 anymore, this has started happening.
I think I found a proper fix. If you change to have , I managed to get passed this build issue with c-static-dylib. So we should change configure to use clang by default if it detects we are on 10.9.
Another option is to add to the line in : <pre--- a/src/test/run- +++ b/src/test/run- -1,5 +1,5 RUSTC := (TMPDIR) -L $(TMPDIR) -CC := (TMPDIR) +CC := (TMPDIR) RUN = (1) FAILS = (1) && exit 1 exit 0 </preSee:
This is probably not quite enough since this option doesn't seem to exist in gcc. Do we have a CFG variable that detects whether we're using clang or gcc?

Discussion:
err "either clang or gcc is required" fi <ins> # OS X 10.9, gcc is actually clang. This can cause some confusion in the build # system, so if we find that gcc is clang, we should just use clang directly. if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ] then CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version") if [ $? -eq 0 ] then step_msg "on OS X 10.9, forcing use of clang" CFG_ENABLE_CLANG=1 putvar CFG_ENABLE_CLANG fi fi </ins> if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ] then step_msg "using custom LLVM at $CFG_LLVM_ROOT"
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. --ICE with in I just noticed the error actually says openpgp-card at the bottom, perhaps compilation doesn't even get to the final crate. In any case, I'm no good at minimizing these things, so I'm handing this off to people who are good at that. <!-- 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 +E-needs-mcve
searched nightlies: from nightly-2023-01-01 to nightly-2023-01-15 regressed nightly: nightly-2023-01-14 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.5</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </details
This fixes the ICE, although I'm not sure if that's the right approach
label -E-needs-mcve

Discussion:
}); cx.emit_spanned_lint(DEREF_INTO_DYN_SUPERTRAIT, cx.tcx.def_span(item.owner_id.def_id), SupertraitAsDerefTarget { t, <del> target_principal: target_principal.to_string(), </del> <ins> target_principal, </ins> label, }); }

}; use rustc_hir::def_id::DefId; use rustc_macros::{LintDiagnostic, Subdiagnostic}; <del> use rustc_middle::ty::{Predicate, Ty, TyCtxt}; </del> <ins> use rustc_middle::ty::{PolyExistentialTraitRef, Predicate, Ty, TyCtxt}; </ins> use rustc_session::parse::ParseSess; use rustc_span::{edition::Edition, sym, symbol::Ident, Span, Symbol};

#[diag(lint_supertrait_as_deref_target)] pub struct SupertraitAsDerefTarget<'a> { pub t: Ty<'a>, <del> pub target_principal: String, // pub target_principal: Binder<'a, ExistentialTraitRef<'b>>, </del> <ins> pub target_principal: PolyExistentialTraitRef<'a>, </ins> #[subdiagnostic] pub label: Option<SupertraitAsDerefTargetLabel>, }

} } <ins> impl rustc_errors::IntoDiagnosticArg for PolyExistentialTraitRef<'_> { fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { self.to_string().into_diagnostic_arg() } } </ins> #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)] #[derive(HashStable)] pub enum BoundVariableKind {

<ins> // check-pass // check that `deref_into_dyn_supertrait` doesn't cause ICE by eagerly converting // a cancelled lint #![allow(deref_into_dyn_supertrait)] trait Trait {} impl std::ops::Deref for dyn Trait + Send + Sync { type Target = dyn Trait; fn deref(&self) -> &Self::Target { self } } fn main() {} </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. --Possibly related to ? in The error message is in building but I can't reproduce with just building that crate, which is odd. <!-- 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<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
label +E-needs-mcve
I'm pretty sure I know how to make an MCVE for this. claim
Ah, lol, it's because hasn't landed, and a recent ReError PR made it delay a bug that should've been handled more gracefully. If you build assertor with (or add ) then it ICEs similarly.

Discussion:
ty::ReVar(rid) => match self.values[rid] { VarValue::Empty(_) => r, VarValue::Value(r) => r, <del> VarValue::ErrorValue => tcx.mk_re_error_misc(), </del> <ins> VarValue::ErrorValue => tcx.lifetimes.re_static, </ins> }, _ => r, };

<ins> // check-pass // Allow this for now, can remove this UI test when this becomes a hard error. #![allow(implied_bounds_entailment)] use std::collections::hash_map::{Keys, HashMap}; use std::marker::PhantomData; trait MapAssertion<'a, K, V, R> { fn key_set(&self) -> Subject<Keys<K, V>, (), R>; } struct Subject<'a, T, V, R>(PhantomData<(&'a T, V, R)>); impl<'a, K, V, R> MapAssertion<'a, K, V, R> for Subject<'a, HashMap<K, V>, (), R> { fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> { todo!() } } fn main() {} </ins>

<ins> Future incompatibility report: Future breakage diagnostic: warning: impl method assumes more implied bounds than the corresponding trait method --> $DIR/resolve-re-error-ice.rs:17:16 | LL |     fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> { |                ^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this type to make the impl signature compatible: `Subject<'_, std::collections::hash_map::Keys<'_, K, V>, (), R>` | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #105572 <https://github.com/rust-lang/rust/issues/105572> note: the lint level is defined here --> $DIR/resolve-re-error-ice.rs:4:10 | LL | #![allow(implied_bounds_entailment)] |          ^^^^^^^^^^^^^^^^^^^^^^^^^ </ins>
Change:
Having written Python for several hours, I made this mistake and couldn't realize what was wrong for a while. No response claim <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I'm not sure whether it's worth to fix this right now. will significantly change this code, basically requiring a rewrite of this diagnostic.
Agreed, it's reasonable to wait for type ascription removal. Thanks for the info!
Now we should fix this error message: is not OK, we'd better suggest to use . I think you need to add proper logic for this part of code:

Discussion:
) } <ins> /// Returns `true` if the token is the integer literal. pub fn is_integer_lit(&self) -> bool { matches!(self.kind, Literal(Lit { kind: LitKind::Integer, .. })) } </ins> /// Returns `true` if the token is a non-raw identifier for which `pred` holds. pub fn is_non_raw_ident_where(&self, pred: impl FnOnce(Ident) -> bool) -> bool { match self.ident() {

snapshot.recover_diff_marker(); } if self.token == token::Colon { <del> // if next token is following a colon, it's likely a path // and we can suggest a path separator self.bump(); if self.token.span.lo() == self.prev_token.span.hi() { </del> <ins> // if a previous and next token of the current one is // integer literal (e.g. `1:42`), it's likely a range // expression for Pythonistas and we can suggest so. if self.prev_token.is_integer_lit() && self.may_recover() && self.look_ahead(1, |token| token.is_integer_lit()) { // FIXME(hkmatsumoto): Might be better to trigger // this only when parsing an index expression. </ins> err.span_suggestion_verbose( <del> self.prev_token.span, "maybe write a path separator here", "::", </del> <ins> self.token.span, "you might have meant a range expression", "..", </ins> Applicability::MaybeIncorrect, ); <del> } if self.sess.unstable_features.is_nightly_build() { // FIXME(Nilstrieb): Remove this again after a few months. err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>"); </del> <ins> } else { // if next token is following a colon, it's likely a path // and we can suggest a path separator self.bump(); if self.token.span.lo() == self.prev_token.span.hi() { err.span_suggestion_verbose( self.prev_token.span, "maybe write a path separator here", "::", Applicability::MaybeIncorrect, ); } if self.sess.unstable_features.is_nightly_build() { // FIXME(Nilstrieb): Remove this again after a few months. err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>"); } </ins> } }

<ins> // edition:2021 fn main() { &[1, 2, 3][1:2]; //~^ ERROR: expected one of //~| HELP: you might have meant a range expression } </ins>

<ins> error: expected one of `.`, `?`, `]`, or an operator, found `:` --> $DIR/range-index-instead-of-colon.rs:4:17 | LL |     &[1, 2, 3][1:2]; |                 ^ expected one of `.`, `?`, `]`, or an operator | help: you might have meant a range expression | LL |     &[1, 2, 3][1..2]; |                 ~~ error: aborting due to 1 previous error </ins>
Change:
is unacceptably slow. Consider this code: When trying this code, make sure you have enabled release mode. On my local machine I see this output: So is 15x slower than . My rustc version is . My OS is Debian Stretch x86_64
label +A-process +I-slow
On windows they are both equally fast, so it seems to be a unix-specific thing. Also note that these two programs are not equivalent, as also reads , while you don't (this probably introduces some overhead). Still seems worth at least investigating.
What's the magnitude of slowness here? and what's the time taken on windows? Here's it on my computer, built with release mode My computer : Apple M1 Mac Mini, 16gb RAM and 8 CPU Cores
. I just compared old rustc () and new one, with this fix (). I see that the bug is actually fixed, thanks a lot! Moreover, both benchmarks became faster

Discussion:
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { (**self).read(buf) } <ins> fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { (**self).read_buf(cursor) } </ins> } impl AsInner<OwnedFd> for FileDesc {
Change:
master at with debug assertions <details<summary<strongBacktrace</strong</summary<p</p Related to , but not fixed by label requires-debug-assertions S-bug-has-mcve
Interestingly, while doesn't fix this, the error is instead:
good

Discussion:
<ins> fn foo() {} fn main() { foo(; foo(; } //~ ERROR mismatched closing delimiter </ins>

<ins> error: mismatched closing delimiter: `}` --> $DIR/issue-108242-semicolon-recovery.rs:4:8 | LL | fn main() { |           - closing delimiter possibly meant for this LL |     foo(; LL |     foo(; |        ^ unclosed delimiter LL | } | ^ mismatched closing delimiter error: aborting due to previous error </ins>
Change:
Originally posted by in , see that PR discussion for more detail <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
claim
are you still looking into this? If so, please reassign yourself
claim

Discussion:
// `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | <del> PlaceContext::NonUse(NonUseContext::AscribeUserTy) | </del> <ins> PlaceContext::NonUse(NonUseContext::AscribeUserTy(_)) | </ins> PlaceContext::MutatingUse(MutatingUseContext::AddressOf) | PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) |

Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | UniqueBorrow | AddressOf | Projection, ) => ty::Covariant, <del> PlaceContext::NonUse(AscribeUserTy) => ty::Covariant, </del> <ins> PlaceContext::NonUse(AscribeUserTy(variance)) => variance, </ins> } }

use crate::mir::*; use crate::ty::subst::SubstsRef; <del> use crate::ty::{CanonicalUserTypeAnnotation, Ty}; </del> <ins> use crate::ty::{self, CanonicalUserTypeAnnotation, Ty}; </ins> use rustc_span::Span; macro_rules! make_mir_visitor {

fn super_ascribe_user_ty(&mut self, place: & $($mutability)? Place<'tcx>, <del> _variance: $(& $mutability)? ty::Variance, </del> <ins> variance: $(& $mutability)? ty::Variance, </ins> user_ty: & $($mutability)? UserTypeProjection, location: Location) { self.visit_place( place, <del> PlaceContext::NonUse(NonUseContext::AscribeUserTy), </del> <ins> PlaceContext::NonUse(NonUseContext::AscribeUserTy($(* &$mutability *)? variance)), </ins> location ); self.visit_user_type_projection(user_ty);

/// Ending a storage live range. StorageDead, /// User type annotation assertions for NLL. <del> AscribeUserTy, </del> <ins> AscribeUserTy(ty::Variance), </ins> /// The data of a user variable, for debug info. VarDebugInfo, }

} } <del> #[derive(Copy, Clone, PartialEq, Decodable, Encodable, Hash, HashStable_Generic)] </del> <ins> #[derive(Copy, Clone, PartialEq, Eq, Decodable, Encodable, Hash, HashStable_Generic)] </ins> #[rustc_pass_by_value] pub enum Variance { Covariant,     // T<A> <: T<B> iff A <: B -- e.g., function return type