jiebi/CodeConvo huggingface dataset:
Change:
Here is the code: and the produced error:
The type visitor glue generation code does not support unboxed closures: A quick fix would mimic the visitor glue for boxed closures. Ideally, the interface could be extended to handle unboxed closures separately, which would allow for visting upvars in the closure environment.
Working on the quick fix
Closing as a dupe of

Discussion:
<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(unboxed_closures)] // Test generating type visitor glue for unboxed closures extern crate debug; fn main() { let expected = "fn(); fn(uint, uint) -> uint; fn() -> !"; let result = format!("{:?}; {:?}; {:?}", |:| {}, |&: x: uint, y: uint| { x + y }, |&mut:| -> ! { fail!() }); assert_eq!(expected, result.as_slice()); } </ins>
Change:
As far as I can tell, the purpose of the "illegal recursive type" error (in ) is to prevent types from referring to themselves in their definition, e.g. as done in src/test/compile-fail/infinite-vec-type- (). However, the logic being used to implement this check also disallows the following usage of associated types, which is intended to provide an implementation of the trait on if itself implements (doing so by passing through 's associated type ): It seems like this code should be accepted (though should still fail this check).
This works now.

Discussion:
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs[config.rs] <del> The <<_installation,Installation>> section contains details on configuration for some of the editors. </del> <ins> The <<installation,Installation>> section contains details on configuration for some of the editors. </ins> In general `rust-analyzer` is configured via LSP messages, which means that it's up to the editor to decide on the exact format and location of configuration files. Some clients, such as <<vs-code,VS Code>> or <<coc-rust-analyzer,COC plugin in Vim>> provide `rust-analyzer` specific configuration UIs. Others may require you to know a bit more about the interaction with `rust-analyzer`.
Change:
Test case: rustc output: Expected behavior: is automatically converted to in the call. The bug disappears if is changed to take , if is changed to take , or if the call is changed to . CC
cc
I can sort of imagine why this happens. I'm planning on picking at the method dispatch code over next week and I imagine I can fix this as I go.
Triage visit: this appears to be fixed. Tagging as needs test.
The original message includes a test case. Does it need to be modified somehow or just be in a PR?

Discussion:
<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Regression test for #17746 fn main() {} struct A; impl A { fn b(&mut self) { self.a() } } trait Foo { fn dummy(&self) {} } trait Bar { fn a(&self); } impl Foo for A {} impl<T> Bar for T where T: Foo { fn a(&self) {} } </ins>
Change:
Writing the following works perfectly: While the following: Fails with . This looks like a problem with the type inference, and using fixes this example, but breaks the one that previously worked. When the array is being initialized rather than having the type set: The error is a much more cryptic , and which one fails can again be swapped by multiplying by instead of .
See
This works on 1.1+:
Regression test in

Discussion:
<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. const count : usize = 2 as usize; fn main() { let larger : [usize; count*2]; } </ins>
Change:
As of a few weeks ago was able to parse attributes attached to a quoted method. Recently this fails with a syntax error, See example .
I suspect your commit is the culprit here as it removes a from .

Discussion:
sp: Span, tts: &[ast::TokenTree]) -> Box<base::MacResult+'static> { <del> let e_attrs = cx.expr_vec_ng(sp); let e_visibility = cx.expr_path(cx.path_global(sp, vec!( id_ext("syntax"), id_ext("ast"), id_ext("Inherited")))); let expanded = expand_parse_call(cx, sp, "parse_method", vec!(e_attrs, e_visibility), tts); </del> <ins> let expanded = expand_parse_call(cx, sp, "parse_method_with_outer_attributes", vec!(), tts); </ins> base::MacExpr::new(expanded) }

(ident, ItemFn(decl, fn_style, abi, generics, body), Some(inner_attrs)) } <ins> /// Parse a method in a trait impl pub fn parse_method_with_outer_attributes(&mut self) -> P<Method> { let attrs = self.parse_outer_attributes(); let visa = self.parse_visibility(); self.parse_method(attrs, visa) } </ins> /// Parse a method in a trait impl, starting with `attrs` attributes. pub fn parse_method(&mut self, attrs: Vec<Attribute>,

assert!(i.is_some()); let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {}); <ins> let _k: P<syntax::ast::Method> = quote_method!(cx, #[doc = "hello"] fn foo(&self) {}); </ins> } fn main() {
Change:
I hit an internal compiler error in rustc 0.12.0-nightly ( 2014-10-02 01:22:20 +0000). Notes: trying to compile ncollide / nphysics. It wasn't finding crates, possibly because of ncollide recently switching to use cargo's 'feature' feature, so I was randomly prodding the files trying to get it working. The internal error appears to happen when it's trying to abort after a legitimate error. This is on OSX 10.9.5. Could not compile .
Still happening consistently as of rustc 0.12.0-nightly ( 2014-10-04 23:42:07 +0000). Also, it's not caused by task abort as I speculated above; it happens consistently when trying to compile nphysics's even in the absence of other errors.
Do you have a reduced testcase?
I do not really have a reduced testcase, though, somehow, I was able to work around the ICE on this commit: What I did is to remove explicit calls to and explicitely dereference anything that had the type or before I call . For example, if has the type , I changed to . Note thit this fix is done on . The ICE seems to happend only when is used by another library/binary (and not during the compilation of itself).

Discussion:
<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![crate_type = "rlib"] pub trait Tr { fn tr(&self); } pub struct St<V>(pub Vec<V>); impl<V> Tr for St<V> { fn tr(&self) { match self { &St(ref v) => { v.iter(); } } } } </ins>

<ins> // Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that we don't ICE when translating a generic impl method from // an extern crate that contains a match expression on a local // variable lvalue where one of the match case bodies contains an // expression that autoderefs through an overloaded generic deref // impl. // aux-build:issue-18514.rs extern crate "issue-18514" as ice; use ice::{Tr, St}; fn main() { let st: St<()> = St(vec![]); st.tr(); } </ins>
Change:
The way compiletest drives the test runner bypasses the test lib's command line parsing, which is also where the env var is checked.

Discussion:
logfile: config.logfile.clone(), run_tests: true, run_benchmarks: true, <del> nocapture: false, </del> <ins> nocapture: env::var("RUST_TEST_NOCAPTURE").is_ok(), </ins> color: test::AutoColor, } }

// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> use std::env; </ins> use common::Config; use common; use util;

true }); <ins> for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] { match env::var(key) { Ok(val) => if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() { exec_env.push((key.to_string(), val)) }, Err(..) => {} } } </ins> TestProps { error_patterns: error_patterns, compile_flags: compile_flags,
Change:
This happens on our nightly and dist bots periodically: Here's what configure looks like:
Presumably it's complaining that can't be found, but the makefiles look right to me. Hard to reproduce.
I've only ever seen this get reproduced during an LLVM upgrade on a multi-host builder. I've only sporadically been able to reproduce locally, and if you re-make after the error occurs it does not repeat itself. The only sequence of events I've seen to trigger this is: LLVM in the rust repo (for multiple hosts). LLVM in the rust repo. LLVM again (run make -j), see the error.
Perhaps this is because the rules for the host-specific llvm stamp call the non-host-specific target, so when the build gets to the second LLVM it deletes the just-built LLVM.

Discussion:
# the stamp in the source dir. $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger @$$(call E, make: cleaning llvm) <del> $(Q)$(MAKE) clean-llvm </del> <ins> $(Q)$(MAKE) clean-llvm$(1) </ins> @$$(call E, make: done cleaning llvm) touch $$@
Change:
Both the text and the background are black in the steam ingame browser.
The Steam in-game browser is still on Chromium 35 (known security bugs and all) so I think this is more a problem on their end.
We probably just need to set to a light color ourselves. It wouldn't surprise me if Steam has a user agent style that sets the default background color to dark to match the rest of their UI.
Web frontent engineers would use "CSS Reset" scripts:
we are already using
It doesn't really matter that we're using a CSS reset because CSS resets won't do what was originally asked in this issue. If you set body/headline text color, then you have to set the background color too; otherwise you get conflicts with user and user agent stylesheets, like with Steam's browser. CSS resets don't usually set background or text colors on main elements, and they shouldn't.
A screenshot of what this issue is: !

Discussion:
/* General structure */ body { <ins> background-color: white; </ins> margin: 0 auto; padding: 0 15px; font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
Change:
Tried to compile rustc on my Windows 7 x64 (MSYS2) when it crashed. Crashed even after running first. For the record, I tried to compile with set.
As of parallel codegen is enabled by default. Thus, the crash always occurs when compiling rustc. I was now able to get the full stack backtrace:
cc (looks like a duplicate codegen bug)
Actually we have two different problems here: ICE when linking fails on Windows. I've made an attempt to fix it in of fails with parallel codegen. I've created a new issue () to not confuse these two.

Discussion:
.stdout(::std::io::process::InheritFd(1)) .stderr(::std::io::process::InheritFd(2)); match cmd.status() { <del> Ok(_) => {}, </del> <ins> Ok(status) => { if !status.success() { sess.err(format!("linking of {} with `{}` failed", output_path.display(), cmd).as_slice()); sess.abort_if_errors(); } }, </ins> Err(e) => { sess.err(format!("could not exec the linker `{}`: {}", pname,
Change:
O, the heartbreak! ;) not sure if you want to add a counter or remove the promise.
Either works. I've done both versions. Probably just remove the promise.
Closed by

Discussion:
the guessing game. Here's how it works: Our program will generate a random integer between one and a hundred. It will then prompt us to enter a guess. Upon entering our guess, it will tell us if we're too low or too high. Once we <del> guess correctly, it will congratulate us, and print the number of guesses we've taken to the screen. Sound good? </del> <ins> guess correctly, it will congratulate us. Sound good? </ins> ## Set up
Change:
compiles without a peep, even though and are unused. Commenting out the gives the expected output:
I think this an be closed
Thanks (fixed in )

Discussion:
this.pat_bindings(&**pat, |this, ln, var, sp, id| { this.warn_about_unused(sp, id, ln, var); }); <ins> visit::walk_expr(this, expr); </ins> } // no correctness conditions related to liveness

<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![deny(unused_variable)] fn main() { for _ in range(1i, 101) { let x = (); //~ ERROR: unused variable: `x` match () { a => {} //~ ERROR: unused variable: `a` } } } </ins>
Change:
This should not compile, since is for some non- and thus will contain as well. It compiles fine however and results in the varying output depending on the optimization level (which shows that this is an UB out of the "safe" code). Tested with and playpen.
A more self-contained example that shouldn't type-check:
It seems that this has been possible since generalized lifetime bounds went in.
Huh. This was supposed to be fixed. I'll take a look.
P-backcompat-lang, 1.0
OK, simple oversight. PR coming soon. Amazing we have no test for this. It occurs only with coercions. (In general, this code path could be cleaned up, and will be as part of implementing generalized where clauses, making these kinds of oversights harder to do.)

Discussion:
self.register_unsize_obligations(span, &**u) } ty::UnsizeVtable(ref ty_trait, self_ty) => { <ins> // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` implements `Foo`: </ins> vtable2::register_object_cast_obligations(self, span, ty_trait, self_ty); <ins> // If the type is `Foo+'a`, ensures that the type // being cast to `Foo+'a` outlives `'a`: let origin = infer::RelateObjectBound(span); self.register_region_obligation(origin, self_ty, ty_trait.bounds.region_bound); </ins> } } }

<ins> // Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Test that attempts to implicitly coerce a value into an // object respect the lifetime bound on the object type. fn a(v: &[u8]) -> Box<Clone + 'static> { let x: Box<Clone + 'static> = box v; //~ ERROR does not outlive x } fn b(v: &[u8]) -> Box<Clone + 'static> { box v //~ ERROR does not outlive } fn c(v: &[u8]) -> Box<Clone> { box v // OK thanks to lifetime elision } fn d<'a,'b>(v: &'a [u8]) -> Box<Clone+'b> { box v //~ ERROR does not outlive } fn e<'a:'b,'b>(v: &'a [u8]) -> Box<Clone+'b> { box v // OK, thanks to 'a:'b } fn main() { } </ins>
Change:
cargo is relying on the to find rustc, but if one runs cargo with , cargo will error out with the unhelpful: cargo should detect this and return a proper error message for this. A proper workaround for this is to make sure that has an absolute path to the binaries set, as in: It needs to be absolute because cargo does a chdir to the build directory, which would break a relative path.
We have a function, that cargo can use to determine the path to itself, then use to launch the corresponding rustc.

Discussion:
if c.pgp { pgp::init(c.root); <ins> } else { warn("command "gpg" is not found"); warn("you have to install "gpg" from source " + " or package manager to get it to work correctly"); </ins> } c

let buildpath = fs::connect(_path, "/test"); need_dir(buildpath); #debug("Testing: %s -> %s", cf, buildpath); <del> let p = run::program_output("rustc", ["--out-dir", buildpath, "--test", cf]); </del> <ins> let p = run::program_output(rustc_sysroot(), ["--out-dir", buildpath, "--test", cf]); </ins> if p.status != 0 { error(#fmt["rustc failed: %dn%sn%s", p.status, p.err, p.out]); ret;

let buildpath = fs::connect(_path, "/build"); need_dir(buildpath); #debug("Installing: %s -> %s", cf, buildpath); <del> let p = run::program_output("rustc", ["--out-dir", buildpath, cf]); </del> <ins> let p = run::program_output(rustc_sysroot(), ["--out-dir", buildpath, cf]); </ins> if p.status != 0 { error(#fmt["rustc failed: %dn%sn%s", p.status, p.err, p.out]); ret;

} } <ins> fn rustc_sysroot() -> str { alt os::get_exe_path() { some(_path) { let path = [_path, "..", "bin", "rustc"]; check vec::is_not_empty(path); let rustc = fs::normalize(fs::connect_many(path)); #debug("  rustc: %s", rustc); rustc } none { "rustc" } } } </ins> fn install_source(c: cargo, path: str) { #debug("source: %s", path); fs::change_dir(path);
Change:
ICE when compiling a simple program with . It does not crash when using . It also depends on the program being compiled if it crashes or not.
Smaller example: Compile with does some crazy things with &Void, and it shows up in the log, so it may be related.
This still ICEs for me.
Can't reproduce anymore with
Can't reproduce either

Discussion:
<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. trait Foo { fn answer(self); } struct NoData<T>; //~^ ERROR: parameter `T` is never used impl<T> Foo for T where NoData<T>: Foo { //~^ ERROR: overflow evaluating the requirement fn answer(self) { let val: NoData<T> = NoData; } } fn main() {} </ins>

<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // exec-env:RUST_LOG=rustc::middle=debug fn main() { let b = 1isize; println!("{}", b); } </ins>
Change:
change this to something more appropriate. This was introduced in commit when still returned . This should either block until a message from the correct sender arrives or return an error.

Discussion:
/// /// Note that this call does not perform any actual network communication, /// because UDP is a datagram protocol. <ins> #[deprecated = "`UdpStream` has been deprecated"] #[allow(deprecated)] </ins> pub fn connect(self, other: SocketAddr) -> UdpStream { UdpStream { socket: self,

/// A type that allows convenient usage of a UDP stream connected to one /// address via the `Reader` and `Writer` traits. <ins> /// /// # Note /// /// This structure has been deprecated because `Reader` is a stream-oriented API but UDP /// is a packet-oriented protocol. Every `Reader` method will read a whole packet and /// throw all superfluous bytes away so that they are no longer available for further /// method calls. #[deprecated] </ins> pub struct UdpStream { socket: UdpSocket, connected_to: SocketAddr

} impl Reader for UdpStream { <ins> /// Returns the next non-empty message from the specified address. </ins> fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { let peer = self.connected_to; self.as_socket(|sock| { <del> match sock.recv_from(buf) { Ok((_nread, src)) if src != peer => Ok(0), Ok((nread, _src)) => Ok(nread), Err(e) => Err(e), </del> <ins> loop { let (nread, src) = try!(sock.recv_from(buf)); if nread > 0 && src == peer { return Ok(nread); } </ins> } }) }

} #[test] <ins> #[allow(deprecated)] </ins> fn stream_smoke_test_ip4() { let server_ip = next_test_ip4(); let client_ip = next_test_ip4(); <ins> let dummy_ip = next_test_ip4(); </ins> let (tx1, rx1) = channel(); let (tx2, rx2) = channel(); spawn(proc() { <del> match UdpSocket::bind(client_ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); rx1.recv(); stream.write([99]).unwrap(); </del> <ins> let send_as = |ip, val: &[u8]| { match UdpSocket::bind(ip) { Ok(client) => { let client = box client; let mut stream = client.connect(server_ip); stream.write(val).unwrap(); } Err(..) => fail!() </ins> } <del> Err(..) => fail!() } </del> <ins> }; rx1.recv(); send_as(dummy_ip, [98]); send_as(client_ip, [99]); </ins> tx2.send(()); });

assert_eq!(nread, 1); assert_eq!(buf[0], 99); } <del> Err(..) => fail!() </del> <ins> Err(..) => fail!(), </ins> } } Err(..) => fail!()

} #[test] <ins> #[allow(deprecated)] </ins> fn stream_smoke_test_ip6() { let server_ip = next_test_ip6(); let client_ip = next_test_ip6();
Change:
These would all preferably indicate that the "type" is not actually a type.
I think this is fixed

Discussion:
has type `{}`, which is {}", ol, moved_lp_msg, <del> expr_ty, </del> <ins> moved_lp.ty, </ins> suggestion)); self.tcx.sess.fileline_help(expr_span, help); }

<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. const X: u8 = 1; static Y: u8 = 1; fn foo() {} impl X {} //~^ ERROR use of undeclared type name `X` impl Y {} //~^ ERROR use of undeclared type name `Y` impl foo {} //~^ ERROR use of undeclared type name `foo` fn main() {} </ins>

<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct NoCopy; fn main() { let x = NoCopy; let f = move || { let y = x; }; //~^ NOTE `x` moved into closure environment here because it has type `NoCopy` let z = x; //~^ ERROR use of moved value: `x` } </ins>