jiebi/CodeConvo huggingface dataset:
Change:
Can confirm. Saw this a week or so ago but assumed my local install was busted.
I've used it successfully with . Is there a difference?
EDIT: I was wrong, fails exactly the same way as it does with an environment variable.
Oh wait, I was getting this failure while using
I had a closer look at this issue. adds to the arguments passed to the executable to be tested. At the moment, does not accept a argument, because it is not needed for any test in , even the tests in do not use . I have updated the makefile to only add the flag for crate tests. I do not think that changing add to the run arguments of all compile tests makes sense, because it would mess up tests which check command line arguments. Also the bench option can be as comment in a compile test as well.

Discussion:
TESTARGS += --ignored endif # Arguments to the cfail/rfail/rpass/bench tests ifdef CFG_VALGRIND CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)" endif <del> ifdef PLEASE_BENCH TESTARGS += --bench endif </del> # Arguments to the perf tests ifdef CFG_PERF_TOOL CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"

CTEST_TESTARGS := $(TESTARGS) <ins> # --bench is only relevant for crate tests, not for the compile tests ifdef PLEASE_BENCH TESTARGS += --bench endif </ins> ifdef VERBOSE CTEST_TESTARGS += --verbose endif
Change:
I tried pulling the old on rustc, and depending on the syntax used it either works as expected or plainly crashes. This works just fine: However this really upsets the compiler:
Is this a dup of ?
The code currently compiles, so I believe this issue can be closed.
I'll add a regression test

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 A<T: A<T>> {} fn main() {} </ins>
Change:
Compiler version (running on OS X 10.10.1): To reproduce the ICE:
Triage: still ICEs.
Triage: Still ICEs. Given information on what should happen here, I'd be willing to look into fixing this, [this] function seems to be the likely location of the fix. From IRC:

Discussion:
None); let (odir, ofile) = make_output(&matches); <del> let (input, input_file_path) = match make_input(&matches.free) { Some((input, input_file_path)) => callbacks.some_input(input, input_file_path), </del> <ins> let (input, input_file_path, input_err) = match make_input(&matches.free) { Some((input, input_file_path, input_err)) => { let (input, input_file_path) = callbacks.some_input(input, input_file_path); (input, input_file_path, input_err) }, </ins> None => match callbacks.no_input(&matches, &sopts, &cfg, &odir, &ofile, &descriptions) { <del> Some((input, input_file_path)) => (input, input_file_path), </del> <ins> Some((input, input_file_path)) => (input, input_file_path, None), </ins> None => return (Ok(()), None), }, };

sopts, input_file_path.clone(), descriptions, codemap, emitter_dest, ); <ins> if let Some(err) = input_err { // Immediately stop compilation if there was an issue reading // the input (for example if the input stream is not UTF-8). sess.err(&format!("{}", err)); return (Err(CompileIncomplete::Stopped), Some(sess)); } </ins> let trans = get_trans(&sess); rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));

} // Extract input (string or file and optional path) from matches. <del> fn make_input(free_matches: &[String]) -> Option<(Input, Option<PathBuf>)> { </del> <ins> fn make_input(free_matches: &[String]) -> Option<(Input, Option<PathBuf>, Option<io::Error>)> { </ins> if free_matches.len() == 1 { let ifile = &free_matches[0]; if ifile == "-" { let mut src = String::new(); <del> io::stdin().read_to_string(&mut src).unwrap(); </del> <ins> let err = if io::stdin().read_to_string(&mut src).is_err() { Some(io::Error::new(io::ErrorKind::InvalidData, "couldn't read from stdin, as it did not contain valid UTF-8")) } else { None }; </ins> Some((Input::Str { name: FileName::Anon, input: src }, <del> None)) </del> <ins> None, err)) </ins> } else { Some((Input::File(PathBuf::from(ifile)), <del> Some(PathBuf::from(ifile)))) </del> <ins> Some(PathBuf::from(ifile)), None)) </ins> } } else { None

<ins> -include ../tools.mk all: cp non-utf8 $(TMPDIR)/non-utf.rs cat $(TMPDIR)/non-utf.rs | $(RUSTC) - 2>&1  | $(CGREP) "error: couldn't read from stdin, as it did not contain valid UTF-8" </ins>
Change:
I compiled this program with a tip build: and got this in the output: BTW, the "and" in the first note probably should be an "or", to match the "either".
Just sumbitted a PR to fix this.
Still unmarked in stable, beta, nightly. Note the playpen won't let you compile this at all in stable, beta because of unstable.
This can be closed - is private now, even if it were still public it would be fixed by

Discussion:
if self.tcx.sess.features.borrow().unmarked_api { self.tcx.sess.span_warn(span, "use of unmarked library feature"); self.tcx.sess.span_note(span, "this is either a bug in the library you are  <del> using and a bug in the compiler - please  </del> <ins> using or a bug in the compiler - please  </ins> report it in both places"); } else { self.tcx.sess.span_err(span, "use of unmarked library feature"); self.tcx.sess.span_note(span, "this is either a bug in the library you are  <del> using and a bug in the compiler - please  </del> <ins> using or a bug in the compiler - please  </ins> report it in both places"); self.tcx.sess.span_note(span, "use #![feature(unmarked_api)] in the  crate attributes to override this");
Change:
As far as I can tell, the following type alias is unusable: This isn't a complete type because is unspecified and isn't usable because there is no way to specify (as far as I know) after the fact. Personally, I feel type aliases like this should be compile time errors. I'm bringing this nitpick up now because fixing it is technically a breaking change .
now gives: So this looks fixed!

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. pub trait Foo { type A; } type I<'a> = &'a (Foo + 'a); //~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified fn main() {} </ins>
Change:
Markdown list items separated by blank lines are wrapped in p tags within li tags ("loose" list). formatting. List items not separated by blank lines use only li tags ("tight" list). Links in loose lists are displayed in blue and are easily distinguishable as links. Links in tight lists are normal text colored and do not appear as links (although clicking them still works). Examples of both list types follow: Adding the missing formatting to loose lists is difference appears to be straight-forward CSS change. In , two rules control link appearance in loose lists (lines 377 & 378 in the commit): Adding a second selector to each rule colors the links: There are only two other li rules and these do not affect color. So, the change above may be all that is needed to fix this issue.
Just patched locally and can confirm it works. Thanks! R/Scott

Discussion:
try!(write!(fmt, r##"<span id='render-detail'> <del> <a id="collapse-all" href="#">[-] </a>&nbsp;<a id="expand-all" href="#">[+]</a> </del> <ins> <a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a> </ins> </span>"##)); // Write `src` tag

color: #000; background: transparent; } <del> p a { color: #4e8bca; } p a:hover { text-decoration: underline; } </del> <ins> .docblock a { color: #4e8bca; } .docblock a:hover { text-decoration: underline; } </ins> .content span.trait, .content a.trait, .block a.current.trait { color: #ed9603; } .content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
Change:
One of the methods takes , the other takes , which is strange, since they are almost exactly the same code. I'm guessing that should take , like does.
cc
isn't this because consumes the iterator completely and only up to the first occurrence?
both iterators behave the same way, stops at the first value, stops at the first value.
Thanks for the report, This was a mistake, and both should take precisely to clarify the consumption semantics. This should be a trivial fix.
(Should be flagged 1.0-beta P-backcompat-libs)
0 beta, P-backcompat-libs.

Discussion:
/// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] <del> fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool { for x in self { if !f(x) { return false; } } </del> <ins> fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool { for x in self.by_ref() { if !f(x) { return false; } } </ins> true }

let types_a = substs_a.types.get_slice(subst::TypeSpace); let types_b = substs_b.types.get_slice(subst::TypeSpace); <del> let pairs = types_a.iter().zip(types_b.iter()); </del> <ins> let mut pairs = types_a.iter().zip(types_b.iter()); </ins> pairs.all(|(&a, &b)| same_type(a, b)) }
Change:
See e.g. It seems what instead of , is required. E.g. () produces
I tried to search already reported issue, no luck. If it's something really worthy, I might try to come up with PR to fix it.
So, does it qualify for a proper PR? I'm new in Rust ecosystem and I thought it could be a good way to both contribute back and start small, e.g. understand how the whole process works ... ;) Edit s/smart/small/
yes, absolutely! If you have the time, that'd be great.
You can check out for full details, but basically, just make a pull request :)
Great, will do it some time during this week.
fixed the issue seems to be updated, closing this one.

Discussion:
//!     * `o` - precedes the argument with a "0o" //! * '0' - This is used to indicate for integer formats that the padding should //!         both be done with a `0` character as well as be sign-aware. A format <del> //!         like `{:08d}` would yield `00000001` for the integer `1`, while the </del> <ins> //!         like `{:08}` would yield `00000001` for the integer `1`, while the </ins> //!         same format would yield `-0000001` for the integer `-1`. Notice that //!         the negative version has one fewer zero than the positive version. //!
Change:
rustc: provided the following output But the link seems broken: ! The same link also appears on Here is more of the rustc output:
Ah yes, this should link to now
It looks like this has been addressed in .
Awesome, thanks!

Discussion:
* [Language Design FAQ](complement-design-faq.html) * [Language FAQ](complement-lang-faq.html) * [Project FAQ](complement-project-faq.html) <del> * [How to submit a bug report](complement-bugreport.html) </del> <ins> * [How to submit a bug report](https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports) </ins> # The standard library
Change:
passes the crate name to verbatim, so the leading hyphen is treated as an option. I think the best solution would be to ban leading hyphens altogether, since there's no real use case for these shenanigans.
I believe we can handle crate names starts with hyphen properly, so we don't have to ban leading hyphens.
Do you have a concrete use case for them?
no, but I'd love to make Rust to handle corner cases, as people may argue Rust don't even need to work on Windows. I made a patch to fix it but failed, I'm finding the reason, hope I can make a PR today or tomorrow.

Discussion:
}; if s.len() == 0 { err("crate name must not be empty"); <ins> } else if s.char_at(0) == '-' { err(&format!("crate name cannot start with a hyphen: {}", s)); </ins> } for c in s.chars() { if c.is_alphanumeric() { continue } if c == '_' || c == '-' { continue } <del> err(&format!("invalid character `{}` in crate name: `{}`", c, s)[]); </del> <ins> err(&format!("invalid character `{}` in crate name: `{}`", c, s)); </ins> } match sess { Some(sess) => sess.abort_if_errors(),

cp foo.rs $(TMPDIR)/+foo+bar $(RUSTC) $(TMPDIR)/+foo+bar 2>&1  | grep "invalid character.*in crate name:" <ins> cp foo.rs $(TMPDIR)/-foo.rs $(RUSTC) $(TMPDIR)/-foo.rs 2>&1  | grep "crate name cannot start with a hyphen:" </ins>
Change:
The way we currently check type parameters is inconsistent and error prone. The code below compiles and it shouldn't. The phase currently ignores these checks and leaves them up to , and , which as demonstrated by bugs like this one and makes this check unsound.
Triage: this still compiles.
Triage: Still compiles.
Marking as E-needstest.

Discussion:
<ins> // Copyright 2017 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. fn is_copy<T: ::std::marker<i32>::Copy>() {} //~^ ERROR type parameters are not allowed on this type [E0109] fn main() {} </ins>
Change:
Assertion in the following code is accepted, which breaks the behaviour I was relying on. This bug has been present already on 2014-11-21. It's one-line fix, I'll try making a PR.
Heh, that's kind of amusing.

Discussion:
let is_signed_ty = (0 as $T) > Int::min_value(); match src.slice_shift_char() { <ins> Some(('-', "")) => Err(PIE { kind: Empty }), </ins> Some(('-', src)) if is_signed_ty => { // The number is negative let mut result = 0;

assert_eq!("-9223372036854775808".parse::<i64>().ok(), Some(i64_val)); assert_eq!("-9223372036854775809".parse::<i64>().ok(), None); } <ins> #[test] fn test_int_from_minus_sign() { assert_eq!("-".parse::<i32>().ok(), None); } </ins> }
Change:
See discussion on .
The ability to convert token-trees AST is also needed to
Do we need that ability here? It's only about interpolated matches.
Fixed in .

Discussion:
use errors::{Handler, DiagnosticBuilder}; use ext::tt::macro_parser::{NamedMatch, MatchedSeq, MatchedNonterminal}; use parse::token::{DocComment, MatchNt, SubstNt}; <del> use parse::token::{Token, NtIdent, SpecialMacroVar}; </del> <ins> use parse::token::{Token, Interpolated, NtIdent, NtTT, SpecialMacroVar}; </ins> use parse::token; use parse::lexer::TokenAndSpan; use tokenstream::{self, TokenTree};

} // FIXME #2887: think about span stuff here TokenTree::Token(sp, SubstNt(ident)) => { <del> r.stack.last_mut().unwrap().idx += 1; </del> match lookup_cur_matched(r, ident) { None => { <ins> r.stack.last_mut().unwrap().idx += 1; </ins> r.cur_span = sp; r.cur_tok = SubstNt(ident); return ret_val;

// (a) idents can be in lots of places, so it'd be a pain // (b) we actually can, since it's a token. MatchedNonterminal(NtIdent(ref sn)) => { <ins> r.stack.last_mut().unwrap().idx += 1; </ins> r.cur_span = sn.span; r.cur_tok = token::Ident(sn.node); return ret_val; } <ins> MatchedNonterminal(NtTT(ref tt)) => { r.stack.push(TtFrame { forest: TokenTree::Token(sp, Interpolated(NtTT(tt.clone()))), idx: 0, dotdotdoted: false, sep: None, }); } </ins> MatchedNonterminal(ref other_whole_nt) => { <ins> r.stack.last_mut().unwrap().idx += 1; </ins> // FIXME(pcwalton): Bad copy. r.cur_span = sp; <del> r.cur_tok = token::Interpolated((*other_whole_nt).clone()); </del> <ins> r.cur_tok = Interpolated((*other_whole_nt).clone()); </ins> return ret_val; } MatchedSeq(..) => {

} TokenTree::Token(_, token::SpecialVarNt(..)) => 2, TokenTree::Token(_, token::MatchNt(..)) => 3, <ins> TokenTree::Token(_, token::Interpolated(Nonterminal::NtTT(..))) => 1, </ins> TokenTree::Delimited(_, ref delimed) => delimed.tts.len() + 2, TokenTree::Sequence(_, ref seq) => seq.tts.len(), TokenTree::Token(..) => 0,

TokenTree::Token(sp, token::Ident(kind))]; v[index].clone() } <ins> (&TokenTree::Token(_, token::Interpolated(Nonterminal::NtTT(ref tt))), _) => { tt.clone().unwrap() } </ins> (&TokenTree::Sequence(_, ref seq), _) => seq.tts[index].clone(), _ => panic!("Cannot expand a token tree"), }

<ins> // Copyright 2016 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(rustc_attrs)] macro_rules! foo { ($x:tt) => (type Alias = $x<i32>;) } foo!(Box); #[rustc_error] fn main() {} //~ ERROR compilation successful </ins>
Change:
I can confirm this is still an issue with the latest 1.0 beta:
I get the same error with both stable and nightly with:
These examples compile on Playpen Nightly.
I'll go ahead and add regression tests for this

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. pub fn main() { struct Fun<F>(F); let f = Fun(|x| 3*x); let Fun(g) = f; println!("{:?}",g(4)); } </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. pub fn main() { let f = || || 0; std::thread::spawn(f()); } </ins>
Change:
AFAIK, you can't put private types in "public" items (public as in marked with ). is not explicitly marked with , but for all intent and purposes all the methods in a trait are public if the trait is public. So, I think the should be rejected by the privacy checker. (Or, I could be wrong and this is "correct" behavior - and this wouldn't be the first time that the privacy/module system allows things that I find ) cc
I agree, I think this may have just been accidentally overlooked when implementing associated types.
On Sat, Feb 28, 2015 at 10:59:14PM -0800, Alex Crichton wrote: Yes, that. There was language in the RFC describing trait item signatures and how they should be treated, and I think we just failed to extend that to associated types. Definitely a bug.
triage: P-backcompat-lang (1.0 beta)
Note also that is still open.

Discussion:
} } Some(ref tr) => { <del> // Any private types in a trait impl fall into two </del> <ins> // Any private types in a trait impl fall into three </ins> // categories. // 1. mentioned in the trait definition // 2. mentioned in the type params/generics <ins> // 3. mentioned in the associated types of the impl </ins> // // Those in 1. can only occur if the trait is in // this crate and will've been warned about on the

// Those in 2. are warned via walk_generics and this // call here. visit::walk_path(self, &tr.path); <ins> // Those in 3. are warned with this call. for impl_item in impl_items { match *impl_item { ast::MethodImplItem(..) => {}, ast::TypeImplItem(ref typedef) => { self.visit_ty(&typedef.typ); } } } </ins> } } } else if trait_ref.is_none() && self_is_public_path {

<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. pub struct PublicType; struct PrivateType; pub trait PublicTrait { type Item; } trait PrivateTrait { type Item; } impl PublicTrait for PublicType { type Item = PrivateType;  //~ ERROR private type in exported type signature } // OK impl PublicTrait for PrivateType { type Item = PrivateType; } // OK impl PrivateTrait for PublicType { type Item = PrivateType; } // OK impl PrivateTrait for PrivateType { type Item = PrivateType; } fn main() {} </ins>

fn boo(&self) -> <Self as Foo>::A; } <del> struct Bar; </del> <ins> pub struct Bar; </ins> impl Foo for char { type A = Bar;

} #[derive(PartialEq)] <del> struct Bar; </del> <ins> pub struct Bar; </ins> impl Foo for int { type A = uint;
Change:
This is done when compiling repository. Use on either the entire handmadehero crate, or handmadelibsdl. Warning: Ugly, code ahead! Cleaned up repo: It does need to be across crate lines, and needs to be returned in a result, afaict.
The issue is that I should not be able to write because is a [T]. Same with .
Actually, to that end, why is bigger than a anything? Why is a a fat pointer at all?
Very similar to , , .
Yes it is, pretty much the same. A should not be differently sized from a , at least IMHO, so why is it?
is a with fewer guarantees; one can convert between them freely (if you ensure the guarantees are maintained for -). In particular, this means is a fat pointer to match .
That is weird...
NVM, I now understand why it is a fat pointer. However, this should be an easy fix, right? Why is a mut [T] seen as the same size as a mut T in rustc? Well, now it isn't, so is fixed, but it still panics at .

Discussion:
demand::coerce(fcx, e.span, t_1, &e); } } <del> } else if fcx.type_is_fat_ptr(t_e, span) && !fcx.type_is_fat_ptr(t_1, span) { </del> <ins> } else if fcx.type_is_fat_ptr(t_e, span) != fcx.type_is_fat_ptr(t_1, span) { </ins> fcx.type_error_message(span, |actual| { <del> format!("illegal cast; cast from fat pointer: `{}` as `{}`", </del> <ins> format!("illegal cast; cast to or from fat pointer: `{}` as `{}`  involving incompatible type.", </ins> actual, fcx.infcx().ty_to_string(t_1)) }, t_e, None); } else if !(t_e_is_scalar && t_1_is_trivial) {

// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> // Make sure casts between thin pointer <-> fat pointer are illegal. pub trait Trait {} </ins> fn main() { let a: &[i32] = &[1, 2, 3]; let b: Box<[i32]> = Box::new([1, 2, 3]); let p = a as *const [i32]; <ins> let q = a.as_ptr(); a as usize; //~ ERROR illegal cast b as usize; //~ ERROR illegal cast p as usize; //~ ERROR illegal cast // #22955 q as *const [i32]; //~ ERROR illegal cast </ins> <del> a as usize; //~ ERROR cast from fat pointer b as usize; //~ ERROR cast from fat pointer p as usize; //~ ERROR cast from fat pointer </del> <ins> // #21397 let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR illegal cast let mut fail: *const str = 0 as *const str; //~ ERROR illegal cast </ins> }

extern crate libc; fn main() { <del> let foo: *mut libc::c_void; let cb: &mut Fn() = unsafe { &mut *(foo as *mut Fn()) //~^ ERROR use of possibly uninitialized variable: `foo` </del> <ins> let ptr: *mut () = 0 as *mut _; let _: &mut Fn() = unsafe { &mut *(ptr as *mut Fn()) //~^ ERROR illegal cast </ins> }; }

// except according to those terms. fn main() { <del> 0 as &std::any::Any; //~ ERROR non-scalar cast: `i32` as `&core::any::Any` </del> <ins> 0 as &std::any::Any; //~ ERROR illegal cast </ins> }