jiebi/CodeConvo huggingface dataset:
Change:
I wasn't sure if it was right to report this here or elsewhere, so here it is for now... Trying to compile with works, but running the from the same toolchain results in the following:
looks like
cc
triage: P-high. Removing nomination label.
Easy way to reproduce. empty project to dependencies RLS Errors: And
although supposedly this has been fixed a couple of days ago, latest nightly rls still crashes on petgraph:
Chances are this has been fixed with Could you please update to the newest nightly now and see if you can reproduce this?
yes this is fixed now, thanks!

Discussion:
F: FnOnce(&mut Self), { let item_def_id = self.tcx.hir().local_def_id_from_node_id(item_id); <del> if self.tcx.has_typeck_tables(item_def_id) { let tables = self.tcx.typeck_tables_of(item_def_id); let old_tables = self.save_ctxt.tables; self.save_ctxt.tables = tables; f(self); self.save_ctxt.tables = old_tables; </del> <ins> let tables = if self.tcx.has_typeck_tables(item_def_id) { self.tcx.typeck_tables_of(item_def_id) </ins> } else { <del> f(self); } </del> <ins> self.save_ctxt.empty_tables }; let old_tables = self.save_ctxt.tables; self.save_ctxt.tables = tables; f(self); self.save_ctxt.tables = old_tables; </ins> } fn span_from_span(&self, span: Span) -> SpanData {

); } <del> for field in def.fields() { self.process_struct_field_def(field, item.id); self.visit_ty(&field.ty); } </del> <ins> self.nest_tables(item.id, |v| { for field in def.fields() { v.process_struct_field_def(field, item.id); v.visit_ty(&field.ty); } </ins> <del> self.process_generic_params(ty_params, &qualname, item.id); </del> <ins> v.process_generic_params(ty_params, &qualname, item.id); }); </ins> } fn process_enum(

pub struct SaveContext<'l, 'tcx> { tcx: TyCtxt<'tcx>, tables: &'l ty::TypeckTables<'tcx>, <ins> /// Used as a fallback when nesting the typeck tables during item processing /// (if these are not available for that item, e.g. don't own a body) empty_tables: &'l ty::TypeckTables<'tcx>, </ins> access_levels: &'l AccessLevels, span_utils: SpanUtils<'tcx>, config: Config,

let save_ctxt = SaveContext { tcx, tables: &ty::TypeckTables::empty(None), <ins> empty_tables: &ty::TypeckTables::empty(None), </ins> access_levels: &access_levels, span_utils: SpanUtils::new(&tcx.sess), config: find_config(config),

<ins> // check-pass // compile-flags: -Zsave-analysis trait Trait { type Assoc; } fn main() { struct Data<T: Trait> { x: T::Assoc, } } </ins>
Change:
Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository is needed to fix the fallout. cc do you think you would have time to do the follow-up work? If so, that would be great! cc the PR reviewer, and -- nominating for prioritization.

Discussion:
<del> Subproject commit 68ff8b19bc6705724d1e77a8dc17ffb8dfbbe26b </del> <ins> Subproject commit edd90473ec5ba29b9ae1ee706c982e7046a6e63e </ins>
Change:
When the associated constant of an impl trait is referenced it creates an ICE: This panics on stable and nightly. Tested on , macOS and in Docker: : rustc 1.38.0 ( 2019-09-23) binary: rustc commit-hash: commit-date: 2019-09-23 host: x86_64-unknown-linux-gnu release: 1.38.0 LLVM version: 9.0 The panic originates from the same assertion as in : <details<summaryBacktrace:</summary</details
cc
triage: P-medium. Removing nomination label.
The ICE seems to disappear on latest nightly, could someone confirm it?
Fixed by , but I believe it could do with a compile test

Discussion:
// ignore-tidy-linelength // ignore-wasm32-bare compiled with panic=abort by default <ins> // compile-flags: -Z mir-opt-level=3 </ins> #![feature(box_syntax)] fn main() {

<ins> // build-pass trait AssociatedConstant { const DATA: (); } impl<F, T> AssociatedConstant for F where F: FnOnce() -> T, T: AssociatedConstant, { const DATA: () = T::DATA; } impl AssociatedConstant for () { const DATA: () = (); } fn foo() -> impl AssociatedConstant { () } fn get_data<T: AssociatedConstant>(_: T) -> &'static () { &T::DATA } fn main() { get_data(foo); } </ins>

<ins> // build-pass #![feature(type_alias_impl_trait)] use std::marker::PhantomData; /* copied Index and TryFrom for convinience (and simplicity) */ trait MyIndex<T> { type O; fn my_index(self) -> Self::O; } trait MyFrom<T>: Sized { type Error; fn my_from(value: T) -> Result<Self, Self::Error>; } /* MCVE starts here */ trait F {} impl F for () {} type DummyT<T> = impl F; fn _dummy_t<T>() -> DummyT<T> {} struct Phantom1<T>(PhantomData<T>); struct Phantom2<T>(PhantomData<T>); struct Scope<T>(Phantom2<DummyT<T>>); impl<T> Scope<T> { fn new() -> Self { unimplemented!() } } impl<T> MyFrom<Phantom2<T>> for Phantom1<T> { type Error = (); fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> { unimplemented!() } } impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> { type O = T; fn my_index(self) -> Self::O { MyFrom::my_from(self.0).ok().unwrap() } } fn main() { let _pos: Phantom1<DummyT<()>> = Scope::new().my_index(); } </ins>
Change:
See https://travis- for failed build
Could you please provide a backtrace for the ICE?
cc
cc more const prop fallout?
Seems likely. I'll have some time tonight to look at it.
Minimal repro:
Cc me

Discussion:
StaticKind::Promoted(promoted, promoted_substs) => { let substs = self.subst_from_frame_and_normalize_erasing_regions(promoted_substs); let instance = ty::Instance::new(place_static.def_id, substs); <ins> // Even after getting `substs` from the frame, this instance may still be // polymorphic because `ConstProp` will try to promote polymorphic MIR. if instance.needs_subst() { throw_inval!(TooGeneric); } </ins> self.const_eval_raw(GlobalId { instance, promoted: Some(promoted),

impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A,B> { const MAX: u8 = A::MAX + B::MAX; //~ ERROR any use of this value will cause an error <del> //~| ERROR any use of this value will cause an error </del> } fn foo<T>(_: T) -> &'static u8 {

= note: `#[deny(const_err)]` on by default error[E0080]: evaluation of constant expression failed <del> --> $DIR/issue-50814.rs:18:5 </del> <ins> --> $DIR/issue-50814.rs:17:5 </ins> | LL |     &Sum::<U8,U8>::MAX |     ^----------------- |      | |      referenced constant has errors <del> error: any use of this value will cause an error --> $DIR/issue-50814.rs:13:21 | LL |     const MAX: u8 = A::MAX + B::MAX; |     ----------------^^^^^^^^^^^^^^^- |                     | |                     attempt to add with overflow error: aborting due to 3 previous errors </del> <ins> error: aborting due to 2 previous errors </ins> For more information about this error, try `rustc --explain E0080`.

<ins> // run-pass // This test verifies that the `ConstProp` pass doesn't cause an ICE when evaluating polymorphic // promoted MIR. pub trait ArrowPrimitiveType { type Native; } pub fn new<T: ArrowPrimitiveType>() { assert_eq!(0, std::mem::size_of::<T::Native>()); } impl ArrowPrimitiveType for () { type Native = (); } fn main() { new::<()>(); } </ins>
Change:
tidy should skip RLS files or even more, it should probably skip untracked files.
This is a regression; it was originally reported at and fixed in .
Hm so to be clear it is currently broken but was previously already fixed? We probably just need to re-add target to the filter_dirs list .
This was changed in by I guess there may be good reasons to remove all these directories, I'd say that we need to skip things that are listed on .gitignore :).
I assumed was only created next to the top level so it could not be visited by tidy anyway. If that's not the case, please feel free to re-add it (with a comment, if possible).

Discussion:
"src/tools/rls", "src/tools/rust-installer", "src/tools/rustfmt", <ins> // Filter RLS output directories "target/rls", </ins> ]; skip.iter().any(|p| path.ends_with(p)) }
Change:
The following code results in a const eval divide by zero error, when it cannot actually error at runtime:
Bisected to , which corresponds to . cc BTW, you need to actually use (e.g. by calling it in ) to trigger the error. Just adding won't do it.
Fun thing, it doesn't even depend on the conditions in the if clause: also ICEs
Thanks

Discussion:
} fn get_const(&self, local: Local) -> Option<Const<'tcx>> { <del> let l = &self.ecx.frame().locals[local]; // If the local is `Unitialized` or `Dead` then we haven't propagated a value into it. // // `InterpCx::access_local()` mostly takes care of this for us however, for ZSTs, // it will synthesize a value for us. In doing so, that will cause the // `get_const(l).is_empty()` assert right before we call `set_const()` in `visit_statement` // to fail. if let LocalValue::Uninitialized | LocalValue::Dead = l.value { return None; } </del> self.ecx.access_local(self.ecx.frame(), local, None).ok() } <del> fn set_const(&mut self, local: Local, c: Const<'tcx>) { let frame = self.ecx.frame_mut(); if let Some(layout) = frame.locals[local].layout.get() { debug_assert_eq!(c.layout, layout); } frame.locals[local] = LocalState { value: LocalValue::Live(*c), layout: Cell::new(Some(c.layout)), }; } </del> fn remove_const(&mut self, local: Local) { self.ecx.frame_mut().locals[local] = LocalState { value: LocalValue::Uninitialized,

place) { trace!("checking whether {:?} can be stored to {:?}", value, local); if self.can_const_prop[local] { <del> trace!("storing {:?} to {:?}", value, local); assert!(self.get_const(local).is_none() || self.get_const(local) == Some(value)); self.set_const(local, value); </del> <ins> trace!("stored {:?} to {:?}", value, local); assert_eq!(self.get_const(local), Some(value)); </ins> if self.should_const_prop() { self.replace_with_const(

statement.source_info, ); } <ins> } else { trace!("can't propagate {:?} to {:?}", value, local); self.remove_const(local); </ins> } } }

<ins> // run-pass fn main() { foo(10); } fn foo(mut n: i32) { if false { n = 0i32; } if n > 0i32 { 1i32 / n; } } </ins>

<ins> warning: unused arithmetic operation that must be used --> $DIR/issue-64970.rs:13:9 | LL |         1i32 / n; |         ^^^^^^^^ | = note: `#[warn(unused_must_use)]` on by default </ins>
Change:
For example in here: No sections is shown because they're hidden by default. It should be overloaded with noscript so that they show by default in such case.
cc
Using  for all sections that can be toggled would be a noscript-compatible, interactive solution. It can still be enhanced by javascript to respect global toggles. Edge doesn't support it but that just means edge users will have to rely on javascript as they already do today.
I'm not sure it'd fix the initial issue which made us add this auto-parts hiding. We're doing a lot of changes into the DOM so the goal is to not render it in order to make the rendering way faster. Also, we're currently supporting down to IE9. So if a recent browser like Edge doesn't support it, I'm not too much into using such a feature...
The content of details is hidden by default, only the summary is shown until you open it. So it would keep that property I don't see any problems though
The advantage of the current situation is that it works on all supported browsers whereas would just show everything and slow down the page rendering on old web browsers which are already the slowest. Once we drop old browsers support, I'm all for it but for now, not too much like I said...
Details does not show things by default unless you add the . The same behavior can be implemented in old browsers with CSS rules. Javascript would only have to toggle the attribute. <details<summaryLorem ipsum </summaryLorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et sem et lacus tincidunt posuere id sed orci. Orci varius natoque penatibus et magnis dis parturient montes</details
That doesn't answer my concerns at all:
simplified compatibility shim for IE, omitting the caret styling: This way it would not show everything by default and still would have to be unfolded via JS, exactly the same as today. No negative impact on rendering performance.

Discussion:
.loading-content { display: none; } <ins> #main > h2 + div, #main > h3 + div { display: block; } #main > h2 + h3 { display: flex; } </ins>
Change:
This is the correct output. Notice that one of the errors has a column of whitespace between the line number and the pipes, the next does not. Commit range:
Mentioning who made changes in librustc_errors. Could this be from ?
It looks like this can cause the wrong line number to be printed. :( If you bump the problematic line down to line 100, it prints as 10:
It seems like it might be.
Indeed. Upon closer inspection I've found out that actually changes the semantics of method: after applying this commit, if is not empty, then of them is not compared with , although could actually be greater. The correct code should rather look like this: Although it might be not the bug responsible for this issue, it definetely should be fixed. I'll make a PR with fix ASAP. EDIT:
Subtle. That seems about right.

Discussion:
children.iter() .map(|sub| self.get_multispan_max_line_num(&sub.span)) .max() <del> .unwrap_or(primary) </del> <ins> .unwrap_or(0) .max(primary) </ins> } /// Adds a left margin to every line but the first, given a padding length and the label being
Change:
Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository is needed to fix the fallout. cc do you think you would have time to do the follow-up work? If so, that would be great! cc the PR reviewer, and -- nominating for prioritization.
Caused by
I'm working on this.

Discussion:
<del> Subproject commit 648e5b90b49af483d07caa8e413473a4517853d6 </del> <ins> Subproject commit 5cb983338e924ec85898880d60e65f2a1291b7be </ins>
Change:
Consider the following rust source (in ): It is obvious that it has syntax error. It also seems obvious that the generated error shouldn't depend on name of file except noting the name of file. However, it doesn't happen in practice: Note extra spaces after . Rust version (although it is not strictly relevant, see below): The core issue lies in the . The idea of the code is to make enough space in the beginning of line (filled with spaces) and then overwrite it character by character. However, in order to estimate the required space, which is wrong since in Rust can contain non-ASCII which require more than one byte for storage and keeps lines in s. It means that this isuue reveals itself only when a non-ASCII string is passed as an argument — and that's exactly what's happening in  under very specific circumstances: when processing a primary file, when is set (i. e. ) and when_ name of the primary file happens to have a non-ASCII name. The errorneous code for was introduced in . This bug landed in stable . The obvious fix is to change the line in into cc
I want to raise a question: is it really an issue worth fixing? It fires under very specific circumstances and the fix makes slower for every case, not only these specific ones.
I believe so.

Discussion:
pub fn prepend(&mut self, line: usize, string: &str, style: Style) { self.ensure_lines(line); <del> let string_len = string.len(); </del> <ins> let string_len = string.chars().count(); </ins> // Push the old content over to make room for new content for _ in 0..string_len {
Change:
Consider for example this code (using ): This code will fail to compile due to types which cannot be fully inferred, with an error like this: However neither of these spans are anywhere near to the real problem which is the fact that variant is not inferred for . <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
assign will do some investigation here and see if they can get an idea what's going on (and maybe fix)

Discussion:
} } <ins> impl From<GeneratorKind> for YieldSource { fn from(kind: GeneratorKind) -> Self { match kind { // Guess based on the kind of the current generator. GeneratorKind::Gen => Self::Yield, GeneratorKind::Async(_) => Self::Await, } } } </ins> // N.B., if you change this, you'll probably want to change the corresponding // type structure in middle/ty.rs as well. #[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]

region_scope_tree: &'tcx region::ScopeTree, expr_count: usize, kind: hir::GeneratorKind, <ins> prev_unresolved_span: Option<Span>, </ins> } impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {

debug!("generator_interior: attempting to record type {:?} {:?} {:?} {:?}", ty, scope, expr, source_span); let live_across_yield = scope.map(|s| { self.region_scope_tree.yield_in_scope(s).and_then(|yield_data| { // If we are recording an expression that is the last yield

}).unwrap_or_else(|| Some(YieldData { span: DUMMY_SP, expr_and_pat_count: 0, <del> source: match self.kind { // Guess based on the kind of the current generator. hir::GeneratorKind::Gen => hir::YieldSource::Yield, hir::GeneratorKind::Async(_) => hir::YieldSource::Await, }, </del> <ins> source: self.kind.into(), </ins> })); if let Some(yield_data) = live_across_yield { let ty = self.fcx.resolve_vars_if_possible(&ty); debug!("type in expr = {:?}, scope = {:?}, type = {:?}, count = {}, yield_span = {:?}", expr, scope, ty, self.expr_count, yield_data.span);

yield_data.source); // If unresolved type isn't a ty_var then unresolved_type_span is None <ins> let span = self.prev_unresolved_span.unwrap_or_else( || unresolved_type_span.unwrap_or(source_span) ); </ins> self.fcx.need_type_info_err_in_generator( self.kind, <del> unresolved_type_span.unwrap_or(source_span), </del> <ins> span, </ins> unresolved_type, ) .span_note(yield_data.span, &*note)

} else { debug!("no type in expr = {:?}, count = {:?}, span = {:?}", expr, self.expr_count, expr.map(|e| e.span)); <ins> let ty = self.fcx.resolve_vars_if_possible(&ty); if let Some((unresolved_type, unresolved_type_span)) = self.fcx.unresolved_type_vars(&ty) { debug!("remained unresolved_type = {:?}, unresolved_type_span: {:?}", unresolved_type, unresolved_type_span); self.prev_unresolved_span = unresolved_type_span; } </ins> } } }

region_scope_tree: fcx.tcx.region_scope_tree(def_id), expr_count: 0, kind, <ins> prev_unresolved_span: None, </ins> }; intravisit::walk_body(&mut visitor, body);
Change:
Use attribute on a procedural macro function doesn't work like expected: it triggers a warning message also when library is building and not just in call place. I know that the attribute support is not landed in stable but this warning is present in all channels (stable, beta and nightly). Compiling lib simple by raise follow warning: Sadly this issue make attribute not usable at all for procedural macro. Follow the code to reproduce this issue: <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --This issue has been assigned to via . <!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
The most likely reason is that and friends are used from the proc macro harness automatically generated for proc macro crates. So either the harness should generate (there are precedents for this, e.g. test harness generates ), or should not be reported from "externally generated code", which usually includes macros from other crates, but also code generated by the compiler.
Adding should be a very simple fix - the item referring to the proc macro definition functions is generated in in .
claim

Discussion:
//          use proc_macro::bridge::client::ProcMacro; // //          #[rustc_proc_macro_decls] <ins> //          #[allow(deprecated)] </ins> //          static DECLS: &[ProcMacro] = &[ //              ProcMacro::custom_derive($name_trait1, &[], ::$name1); //              ProcMacro::custom_derive($name_trait2, &["attribute_name"], ::$name2);

).map(|mut i| { let attr = cx.meta_word(span, sym::rustc_proc_macro_decls); i.attrs.push(cx.attribute(attr)); <ins> let deprecated_attr = attr::mk_nested_word_item( Ident::new(sym::deprecated, span) ); let allow_deprecated_attr = attr::mk_list_item( Ident::new(sym::allow, span), vec![deprecated_attr] ); i.attrs.push(cx.attribute(allow_deprecated_attr)); </ins> i });

<ins> // check-pass // force-host // no-prefer-dynamic #![deny(deprecated)] #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::*; #[proc_macro] #[deprecated(since = "1.0.0", note = "test")] pub fn test_compile_without_warning_with_deprecated(_: TokenStream) -> TokenStream { TokenStream::new() } </ins>
Change:
See: <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --This issue has been assigned to via . <!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I'm interested in taking this!
assign

Discussion:
} fn is_copy_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { <del> let (param_env, ty) = query.into_parts(); let trait_def_id = tcx.require_lang_item(lang_items::CopyTraitLangItem, None); tcx.infer_ctxt() .enter(|infcx| traits::type_known_to_meet_bound_modulo_regions( &infcx, param_env, ty, trait_def_id, DUMMY_SP, )) </del> <ins> is_item_raw(tcx, query, lang_items::CopyTraitLangItem) </ins> } fn is_sized_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { <del> let (param_env, ty) = query.into_parts(); let trait_def_id = tcx.require_lang_item(lang_items::SizedTraitLangItem, None); tcx.infer_ctxt() .enter(|infcx| traits::type_known_to_meet_bound_modulo_regions( &infcx, param_env, ty, trait_def_id, DUMMY_SP, )) </del> <ins> is_item_raw(tcx, query, lang_items::SizedTraitLangItem) </ins> } fn is_freeze_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { <ins> is_item_raw(tcx, query, lang_items::FreezeTraitLangItem) } fn is_item_raw<'tcx>( tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>, item: lang_items::LangItem, ) -> bool { </ins> let (param_env, ty) = query.into_parts(); <del> let trait_def_id = tcx.require_lang_item(lang_items::FreezeTraitLangItem, None); </del> <ins> let trait_def_id = tcx.require_lang_item(item, None); </ins> tcx.infer_ctxt() .enter(|infcx| traits::type_known_to_meet_bound_modulo_regions( &infcx,