Invert status output of tests (suffix instead of prefix) | As it is currently running some tests looks like this: ``` test vec4::eq_1 ... ok test vec4::is_zero_0 ... ok test vec4::fmt_0 ... ok test vec4::length_sq_0 ... ok test vec4::is_nan_0 ... ok test vec4::lerp_0 ... ok test vec4::length_0 ... ok test vec4::max_0 ... ok test vec4::mu | labels: A-testsuite, P-low, T-dev-tools


Docs say Rust is not production ready. | https://doc.rust-lang.org/stable/complement-project-faq.html#is-any-part-of-this-thing-production-ready? The above link states that rust is not production ready. Is this a mistake?


Lifetime of fn() converted to &Fn() isn't long enough | ``` rust fn double(x: i32) -> i32 { x * 2 } fn get_double_func() -> &'static (Fn(i32) -> i32) { // Works const GET_DOUBLE_FUNC: &'static (Fn(i32) -> i32) = &double; GET_DOUBLE_FUNC } fn get_double_func_2() -> &'static (Fn(i32) -> i32) { // Error message &double } fn main() {} ``` | labels: C-enhancement, A-lifetimes, T-lang


llvm 3.6 required? (3.5 allowed by configure) | Hi, I'm going to try building rustc 1.3 on an old 32bit debian box - is using the installed llvm 3.5 kosher? Configure doesn't complain so it should probably be ok? I'd like to shorten the build time but not get any nasty suprises afterwards.


There should be an `impl<T> AsMut<[T]> for Vec<T>`. | In [GJ](https://github.com/dwrensha/gj) I have this trait like this: ``` pub trait AsyncRead: 'static { fn try_read<T>(self, buf: T, min_bytes: usize) -> Promise<(Self, T, usize), Error<(Self, T)>> where T: DerefMut<Target=[u8]>, Self: Sized; } ``` I'd like to switch the bound on


ICE: unexpected panic in InferCtxt | Compiling the following code causes a panic: ``` rust use std::result::Result; use std::thread; struct A<H: B> { t: H::Timeout, } trait B { type Timeout; } struct C<F> where F: Factory { f: F, } impl<F> B for C <F> where F: Factory { type Timeout = (); } struct D<F> where F: Fact | labels: I-ICE, P-medium, T-compiler, regression-from-stable-to-beta


[libarena::TypedArena::grow()] alloc size increment is fatal with huge numbers (capacity) | The size of a TypedArena is automatical increased if the TypedArena is full. https://github.com/rust-lang/rust/blob/master/src/libarena/lib.rs#L486 The [grow](https://github.com/rust-lang/rust/blob/master/src/libarena/lib.rs#L500-509) function [calculate](https://github.com/rust- | labels: T-compiler


derive(Default) fails on struct using associated type of param. | `#[derive(Default)]` fails on objects that contain a field of an associated type, even if that field is Default. For example (also https://gist.github.com/4c85bcab2cf9f8c56dc2): ``` rust trait TR { type Assoc : Clone + Copy + Default; } #[derive(Clone, Copy, Default)] struct Foo<


Failed to apply `type` on enum | ``` rust mod test_mod { enum A { Foo, } } type Alias = test_mod::A; let _v = Alias::Foo; // Compile error ``` | labels: A-resolve


Compilation fails in release mode with `debug = true` and `lto = true`. | I've pushed the failing code: https://github.com/dpc/mioco/tree/fails-to-compile . Last commit caused: ``` [futex:rust/mioco] (fails-to-compile!)% rustc --version rustc 1.5.0-nightly (47d125d0f 2015-09-16) [futex:rust/mioco] (fails-to-compile!)% cargo build --release --example ec | labels: A-debuginfo, I-ICE


Macro invocations allow type parameters in the path | `vec::<T,U,V,W::X::Y<Z>>![1,2,3,4];` is valid syntax and compiles to a regular vector. This is because macros use `Path`s, not `Ident`s as their names. Multi-segment paths are disallowed, but the path can have type parameters. We can move macros to `Ident`s, however this would no | labels: A-grammar, A-parser, T-compiler


Regression: Functions with 6+ arguments no longer Clone | ``` rust #[derive(Copy, Clone)] struct Foo { foo: fn(u8, u8, u8, u8, u8, u8), } ``` [Gives an error on nightly/beta](http://is.gd/3isPg0), but not [on stable](https://play.rust-lang.org/?code=%0A%23[derive%28Copy%2C%20Clone%29]%0Astruct%20Foo%20{%0A%20foo%3A%20fn%28u8%2C%20u8%2C% | labels: regression-from-stable-to-beta


Add tests for macro-based impls | A lot of impls for primitives in libcore are done via macros, in lieu of variadic generics. This is done for [tuples](https://github.com/rust-lang/rust/blob/master/src/libcore/tuple.rs), [function pointers](https://github.com/rust-lang/rust/blob/master/src/libcore/ptr.rs#L382), a | labels: E-easy, A-testsuite, C-enhancement


rustc crashes on multiple Drop implementations | When I run 'RUST_BACKTRACE=1 rustc foo.rs', with foo.rs containing the following: struct MyStruct; impl Drop for MyStruct { fn drop(&mut self) { } } impl Drop for MyStruct { fn drop(&mut self) { } } fn main() { } ...I expected a compiler error about multiple implementations of dr | labels: I-ICE, regression-from-stable-to-beta


rust warns about unused assignment erroneously | Like in the program below - ``` fn f() -> Option<i32> { None } fn main() { let mut v = 5; while v != 4 { let _ = match f() { Some(x) => x, None => { v = 4; continue }, }; v = 2; } } <anon>:11:17: 11:18 warning: value assigned to `v` is never read, #[warn(unused_assignments)] on b | labels: A-lints, T-compiler


[Rustonomicon] Show how to convert a trait object into concrete type | Last night somebody asked how to convert a trait object where they knew the concrete type into the concrete type. I tried looking for the answer in the Rustonomicon, but alas, no answer was found. Should this be in there? The answer has to do with transmuting into `std::raw::Trai


Update no_std docs to account for changes in RFC 1184 | https://github.com/rust-lang/rfcs/blob/master/text/1184-stabilize-no_std.md


assertion failed: abi != synabi::RustIntrinsic && abi != synabi::PlatformIntrinsic | ``` Rust extern { pub static FOO: extern "rust-intrinsic" fn(); } fn main() { FOO() } ``` ``` > rustc a.rs a.rs:1:26: 1:54 warning: found function pointer with Rust calling convention in foreign module; consider using an `extern` function pointer, #[warn(improper_ctypes)] on by d | labels: E-easy, A-codegen, I-ICE, E-needs-test, T-compiler, C-bug


ICE in type checker | Code: ``` rust use std::ops::Add; pub trait State: Add<Output=Self> { fn new() -> State<Output=Self>; } ``` Output: ``` thread 'rustc' panicked at 'assertion failed: !ty.needs_infer()', src/librustc_typeck/lib.rs:152 ``` Backtrace: ``` stack backtrace: 1: 0x7f363e5e966e - sys::ba | labels: I-ICE


Fat pointer trait implementations | Currently `Hash` is only implemented for thin pointers, and `Eq`/`PartialEq` aren't implemented for any pointers (but `==` works for all pointers). All of these traits should be implemented for all pointers. Without this, it's impossible to implement generic reference-equality se | labels: T-lang


TRPL: Document that Send and Sync are automatically derived | As far as I can tell, there is no documentation [outside of the _Rustonomicon_](https://doc.rust-lang.org/nomicon/send-and-sync.html) that says that `Send` and `Sync` are automatically derived on datatypes that consist solely of `Send` and `Sync` members, and that all primitives


Book: most links in the `Compiler Plugins` section are dead | At https://doc.rust-lang.org/book/compiler-plugins.html All links to the documentation are dead.


ICE: impl Foo for [u8; usize::BYTES] | I tried this code: ``` pub trait Foo {} impl Foo for [u8; usize::BYTES] {} ``` I expected to see this happen: great success Instead, this happened: error: internal compiler error: unexpected panic ## Meta `rustc --version --verbose`: ``` rustc 1.4.0-nightly (6873b9fee 2015-09-13) | labels: E-easy, E-needs-test, E-mentor, A-associated-items


LLVM assertion with asm! output constraint for "d" on x86 and x86_64 | ``` rust #![feature(asm)] fn main() { let a: usize; unsafe { asm!("" : "=d"(a) : : : ); } } ``` ``` vagrant@vagrant-ubuntu-trusty-64:~$ rustc reg-repro.rs reg-repro.rs:4:9: 4:10 warning: variable `a` is assigned to, but never used, #[warn(unused_variables)] on by default reg-repr | labels: A-inline-assembly, C-bug, requires-nightly


Cannot derive Clone for function pointers with reference args | http://is.gd/8pUCyO ``` #[derive(Copy, Clone)] struct Foo { test: unsafe extern "C" fn(&u32) } ``` outputs ``` <anon>:3:5: 3:37 error: the trait `core::clone::Clone` is not implemented for the type `unsafe extern "C" fn(&u32)` [E0277] <anon>:3 test: unsafe extern "C" fn(&u32) ^~~


trpl: combine Match, Patterns, and "if let" sections | All three of them can be combined into a single "Pattern Matching" section. Also, none of them mentions about irrefutable patterns: ``` rust struct Point { x: i32 } let Point { x } = Point { x: 34 }; ``` (Ref: [Match](https://doc.rust-lang.org/nightly/book/match.html), [Patterns]


Automatically run grammar tests (grammar bot) | How to grammar tests: `make check-grammar` https://github.com/rust-lang/rust/issues/2234 How to add bot to Travis build matrix: https://github.com/rust-lang/rust/pull/28500 | labels: A-grammar, T-infra, C-feature-request


Failing to build rust 1.3.0 | I'm trying to update the upstream NixOS/nixpkgs rust compiler and running into some issues in the build process around building libcore. Here is the specific build log https://gist.github.com/wkennington/8d73d37789b4497bd3f1. However, using the same build with the current HEAD so


Native libraries for the local crate linked in the wrong order | There's currently a [large comment in the compiler](https://github.com/rust-lang/rust/blob/9c1aaeb7b97e34b6688f31c6921d636d27c02e73/src/librustc_trans/back/link.rs#L977-L1009) explaining how we link artifacts in this order: 1. The local object file 2. Rust dependencies 3. Local n | labels: A-linkage


ICE on closure within closure within constant | In rustc 1.3.0 stable the following code triggers an ICE: ``` rust struct FooBar<'a> { func: &'a Fn(&mut u32), } const FOO: FooBar<'static> = FooBar { func: &|bar: &mut u32| { println!("{}", *bar); // This statement results in an ICE. let inner = |bar: &mut u32| { println!("{}",  | labels: I-ICE


Option to control -Werror in makefiles | The existing build rules hardcode `-Werror` flags to gcc. @jauhien [mentioned](https://internals.rust-lang.org/t/perfecting-rust-packaging/2623/37?u=brson) that Gentoo e.g. might want to control this.


ICE: pub extern fn with parameter type &str inside struct impl | ``` struct Test; impl Test { pub extern fn test(val: &str) { } } ``` When you attempt to compile you get: ``` thread 'rustc' panicked at 'assertion failed: index < LLVMCountParams(llfn)', ../src/librustc_llvm/lib.rs:2281 stack backtrace: 1: 0x7f594732b6e9 - sys::backtrace::tracin | labels: E-easy, E-needs-test


`Vec::clone_from` is slow | In the process of implementing #28481 for `BinaryHeap`, I noticed that `Vec::clone_from` is often slower than `Vec::clone`: ``` rust #![cfg_attr(test, feature(test))] #[cfg(test)] extern crate test; macro_rules! bench { ($name:ident, $src_len:expr, $dst_len:expr) => { mod $name {


assertion failure w/(invalid?) inline assembly | This example fails w/an assertion error: http://is.gd/GsxTMy ``` rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h:169: unsigned int llvm::FunctionLoweringInfo::InitializeRegForValue(const llvm::Valu | labels: I-ICE, E-needs-test, A-inline-assembly


Match not working properly with &str | If I'm not mistaken, a string literal in rust is interpreted as a string slice, as in, the type of "hello" is &str. If I want to pattern match a string, I would like to use &str's for syntactic simplicity, as in, (if tmp is of type String): ``` match &tmp { "test" => println!("te | labels: T-lang, C-feature-request


Lifetime bounds on structs do not entirely constrain impl fns | ``` rust struct Foo<'a, 'b: 'a>(&'a &'b i32); impl<'a, 'b> Foo<'a, 'b> { fn foo(&self) {} } ``` compiles. As far as I can tell, the bound on 'b is checked in the definitions of the functions, but isn't checked in the use of them. As a concrete example of this Kimundi/scoped-threa | labels: P-high, T-compiler, I-unsound


llvmdeps.rs isn't regenerated after a reconfigure | Even after a ``` make clean ./configure ... ``` `${TARGET}/rt/llvmdeps.rs` isn't regenerated when building. This can cause weird build errors. Presumably it needs to depend on something, but I'm not sure what at the moment.


Colors messed up in compiler output | ``` $ vim src/lib.rs (BROWN BEGIN)src/lib.rs:153 fn function(&self) -> <result> { src/lib.rs:154 <code> src/lib.rs:155 if <code> { src/lib.rs:156 <code> src/lib.rs:157 } else { src/lib.rs:158 <code> ... warning: (BROWN END)method is never used: `function`, #[warn(dead_code)] on b | labels: A-frontend


intrinsicck is broken in the presence of associated types | The compiler told me to report it, so here goes ;) I tried to compile this code using `cargo build`: https://gist.github.com/fizyk20/4cf1665a18ff800584f1 This is the only file in the crate. Cargo.toml looks like this: ``` [package] name = "peano-array" version = "0.1.0" authors = | labels: I-ICE, E-needs-test


Installation is broken when custom relative libdir path starts with lib/ or when libdir is changed during installation | Gentoo uses installation of multiple rust versions side by side based on the possibility to install libraries to custom locations. At the moment because of this bug (its first part) we need to apply [patch](https://github.com/gentoo/gentoo-rust/blob/master/dev-lang/rust/files/rus | labels: O-linux


Tracking issue for forbidding wildcard deps on crates.io | Tracking issue for https://github.com/rust-lang/rfcs/pull/1241 | labels: B-RFC-approved, T-libs-api


Wishlist: Include syntactically complete examples for every example in the rust-lang book. | The book as it is is wonderful, thank you. I am here to inquire about the possibility of having a second book that includes verbose examples. I know fn main() was left out of the examples for readability but if each example was syntactically complete I could spend a lot less time


Not able to compile on Windows in MinGW anymore | ``` $ make ... compile: x86_64-pc-windows-gnu/rustllvm/ArchiveWrapper.o link: x86_64-pc-windows-gnu/rt/rustllvm.lib rustc: x86_64-pc-windows-gnu/stage0/bin/rustlib/x86_64-pc-windows-gnu/lib/librustc_llvm C:/Users/Nick/GitHub/rust/x86_64-pc-windows-gnu/rt/llvmdeps.rs:78:38: 78:54


why does rustc on OSX use LC_UNIXTHREAD instead of LC_MAIN? | I've noticed that `/usr/local/bin/rustc` on OSX (Yosemite in my case) uses the (I believe deprecated) `LC_UNIXTHREAD` load command to specify the entry point and C runtime initialization routines instead of the standard `LC_MAIN`. Is there a particular reason for this?


the book attributes page isn't practically useful | The [attributes section](http://doc.rust-lang.org/nightly/book/attributes.html) doesn't cover how these rules are applied to typically used libraries or binaries and should be expanded. For example, why does this case fail? It's trying to apply that feature to the enclosing modul


HIR: Move lifetime elision to HIR lowering | If we can | labels: A-HIR


rustdoc weird formatting | Rustdoc does something weird to inline code segments I tried this code: ``` rust /// This function, `test`, is a test. pub fn test() {} ``` I expected to see this happen: (Taken on Rust 1.0) ![image](https://cloud.githubusercontent.com/assets/251161/10093426/52ebb60a-6320-11e5-91 | labels: T-rustdoc


Missing interactive tour of Rust with problems to solve | As a new learner of Rust, I'm reading the book (which is great), but am lacking hands-on problem solving with Rust as I learn. I'd love to see (or help out with) something similar to the [interactive golang tour](https://tour.golang.org/welcome/1). I'm interested if anyone is alr


Confusing error when using unsized types without indirection | ``` rust fn foo(arg: Foo) {} //Foo is a trait fn bar (arg: [i32]) {} fn quz (arg: str) {} ``` All those functions return the following error: **the trait `core::marker::Sized` is not implemented for the type...** This is confusing for a beginner, because it makes you think you ne | labels: C-enhancement, A-diagnostics, T-compiler, D-papercut, D-newcomer-roadblock


libsyntax: Name can be made NonZero | Spawned from https://github.com/rust-lang/rust/pull/28642 `Name` is an index into the string interner's internal array. The first element of this array can be reserved and `Name` will always contain non-zero index. It will make `Option<Name>` and `Option<Ident>` commonly encounte | labels: A-parser


libsyntax: Implementation of PartialEq on Ident is not well behaved | Spawned from https://github.com/rust-lang/rust/pull/28642 There's no one true way to compare `Ident`s. They can be compared non-hygienically (`id1.name == id2.name`), hygienically (`mtwt::resolve(id1) == mtwt::resolve(id2)`), or even member-wise (`id1.name == id2.name && id1.ctxt | labels: A-parser


libsyntax: Consider using Names instead of most Idents in AST datastructures | Spawned from https://github.com/rust-lang/rust/pull/28642 Similar to https://github.com/rust-lang/rust/issues/6993 `Ident`s are strictly necessary for `PathSegment`, `PatIdent` (hygienic identifiers) and `ExprWhile`, `ExprLoop`, `ExprBreak`, `ExprAgain`(hygienic labels). All othe | labels: A-parser


Hint the generic type and possible bounds on the unimplemented trait error | ``` rust fn f<T>(x: T) { x + 4; } fn g<T>(x: T) { println!("{}", x); } fn h<T>(x: T) { trait X {} fn hh<T:X>(x: T) {} hh(x); } ``` Codes like these currently do not point to the original declaration of `T` for missing trait bounds. In some cases rustc even does not indicate which | labels: A-diagnostics


Cannot build rustc on systems that use musl libc | Hey, currently it's not possible to build `rustc` on Alpine Linux because it is based on musl libc. The main problem is that your shipped LLVM version does not contain the patches needed to compile on musl libc. ``` /tmp/rustc-beta/src/llvm/lib/Support/DynamicLibrary.cpp: In stat | labels: A-LLVM


internal compiler error with a unknown value in a slice | struct with unknow value from enum in slice variable I tried this code: ``` rust #[repr(C)] #[derive(Copy, Clone)] pub enum Ipc { CREAT = 0o0001000, // POSIX NOWAIT = 2048, // POSIX } pub struct MsgBuf { pub mtype: u32, pub mtext: [u8; Ipc::MSG_BUFF as usize], // <- The error is  | labels: A-resolve, I-ICE


Empty link name at llvmdeps.rs | Hi everyone. I tried to build rust from github source (). But, I faced below error. configure option is here. ``` shell ./configure --target=i686-unknown-linux-gnu,x86_64-unknown-linux-gnu --enable-clang ``` Then ``` shell rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64


[Windows] Wrong ABI when interfacing with C code | [Here is a gist containing the entire source code if you want to reproduce](https://gist.github.com/tomaka/0949b94ee9b6b8b6799d). When calling the function `foo` defined like this in C: ``` c typedef struct { size_t a; size_t b; size_t c; size_t d; } Foo; size_t foo(void* a, void | labels: O-windows


emphasize that &mut is a distinct type from & in the book | Most if not all the book's discussions on [borrowing](http://doc.rust-lang.org/nightly/book/references-and-borrowing.html) and [mut](http://doc.rust-lang.org/nightly/book/mutability.html) focus on type binding of this sort: ``` rust let i = &mut 3; let j = &7; ``` [Mutability](ht


Rules for matching against variable unclear. | When you have a match statement against a variable the behaviour is unexpected. [I tried this code:](http://is.gd/7AZ2lx) ``` fn main() { let x = 'x'; let c = 'c'; match c { x => println!("Bug? {} {}", x, c), } println!("x: {}", x) } ``` #### I expected to to see this happen: Eit


Constraining associated type of super trait seems impossible | I just tried to do something like this ``` rust use std::ops::{ Deref, DerefMut }; trait Array: Deref + DerefMut where <Self as Deref>::Target = [Self::Item] { type Item; } ``` and various variations of it including ``` rust trait Array: Deref<Target = [Self::Item]> + DerefMut {


Tuple struct patterns can match unit structs | This compiles on stable and nightly, but it shouldn't: ``` rust struct S; fn main() { let S(..) = S; } ``` | labels: T-lang


Clarify in the book that indexing into a vector must be done with a usize | Someone came into the channel today confused at how to index into a vector. Their problem was that the variable that they wanted to use as an index was an `i8`. Casting actually crossed their mind, but they gave up after trying `v[foo as i32]` and `v[foo as isize]`. The page at h


rustdoc search on local machine does not work on Google Chrome on Windows | When documentation is generated for a local project everything works fine except the searching. I looked in the Chrome Console and saw that main.js was generating an error. ![image](https://cloud.githubusercontent.com/assets/4435960/10117518/97a381ba-6451-11e5-8eb7-493b086ab8b9.p


rustdoc searching doesn't clear list of results when X is pressed | When you search for something on the online docs (which I assume are generated using cargo doc) a list of results comes up. When you clear the search bar/press the X button it probably should clear the results to allow you to view the original page. Anyone know how to fix this? | labels: T-rustdoc, C-enhancement


jemalloc seems to be holding onto enormous quantities of memory, causing the appearance of a memory leak | @frankmcsherry came in today asking about help diagnosing a memory leak in timely-dataflow. His program was sitting on 7GB (as observed through the system monitor) with no apparent reason. Eventually we guessed that maybe the allocator was being greedy behind the scenes, and that | labels: A-allocators


ICE in coreutils: ERROR:rbml::reader: failed to find block with tag 56 | When trying to update uutils/coreutils to HEAD, I got this ICE: ``` ERROR:rbml::reader: failed to find block with tag 56 error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://githu | labels: I-ICE


Clarify a sentence in the Iterators section of the book | In the [Iterators section](https://github.com/rust-lang/rust/blame/master/src/doc/trpl/iterators.md#L284-L285) of TRPL where it is talking about `take(n)` the page says, "Note that this has no side effect on the original iterator." It's not really clear what this is trying to con


Possible error in example on subtyping and variance in nomicon | The following piece of code is present at the end of variance chapter in nomicon: ``` rust use std::cell::Cell; struct Foo<'a, 'b, A: 'a, B: 'b, C, D, E, F, G, H> { a: &'a A, // variant over 'a and A b: &'b mut B, // invariant over 'b and B c: *const C, // variant over C d: *mut


Wrong definition of identifiers in Rust Reference | Rust reference says: > An identifier is any nonempty Unicode2 string of the following form: > - The first character has property XID_start > - The remaining characters have property XID_continue The problem with this is that `_` (LOW LINE) is not XID_start (reference: http://www.


command-line help for -{W,A,D,F} is ambiguous (suggests presence of non-existent 'all' option) | I downloaded the rust 1.3.0 distribution; `rustc -W help` says, in part: ``` Available lint options: -W <foo> Warn about <foo> -A <foo> Allow <foo> -D <foo> Deny <foo> -F <foo> Forbid <foo> (deny, and deny all overrides) ``` The documentation here for `-F` suggests to me that `-F | labels: A-frontend, E-easy


'-A unused' does not turn off warnings for unused attributes | Running `rustc` with `-A unused` to turn off complaints about various unused bits in code left the `unused-attribute` warning in place: ``` /usr/local/bin/rustc -O --crate-type staticlib -A unused -o libMP4Metadata.a /home/froydnj/src/gecko-dev.git/media/libstagefright/binding/MP | labels: A-frontend, A-lints


make check-stage1 is currently not working | Lots of [discussion](https://internals.rust-lang.org/t/stage1-tests-and-landing-pads/2606/10) as well as [proposed](https://github.com/rust-lang/rust/pull/28206/files) [fixes](https://github.com/rust-lang/rust/pull/27417). Looks like the best solution for now (from the discuss th


Rustdoc does not compile code pieces if they are not separated from the surrounding text | The following is a perfectly valid Markdown, however, Rustdoc does not compile the piece of code (and, naturally, it is not run as a test with `cargo test`): `````` rust /// This is a test: /// ```rust /// let x = SomeUnknownStructure::new(); /// ``` `````` This, however, does wo | labels: T-rustdoc, T-dev-tools


rustc apparently optimizes away the loop in 3.3 | I just implemented the code in section 3.3 to compare Ruby to Rust. It appears that rustc optimizes away the inner loop of the thread, because I kept increasing the limit and the completion time remained constant. I introduced a simple if statement in the loop, and then I got exp


Rustc does not build with clang | ``` clang++ -O2 -Wall -Werror -g -fPIC -m64 -Qunused-arguments -fno-rtti -Qunused-arguments -c -o x86_64-unknown-linux-gnu/rustllvm/ExecutionEngineWrapper.o -I//usr//include -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -fvisibili | labels: A-LLVM, C-feature-request


--emit dep-info is a little difficult to use | The compiler's `dep-info` output doesn't work quite as one might expect when coming from the land of gcc/clang, for example: 1. If only a `dep-info` file is generated, the output filename is pretty unlikely to what's going to be compiled later on: ``` $ rustc foo.rs --emit dep-in


cfg_target_features not working | How to replicate: ``` $git clone https://github.com/valarauca/getcup.git $cd getcup $cargo build $target/debug/getcup SSE2 compatible ``` Doesn't matter what order the flags are in. Tested on Linux 3.19.0-28, x86_64, i7-4790, built with rustc 1.5.0-nightly (7bf4c885f 2015-09-26)


Deref issue and stack overflow | ``` rust use std::fmt; use std::ops::Deref; #[derive(Clone)] pub struct FileKey(pub String); impl fmt::Display for FileKey { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "{}", self) } } impl Deref for FileKey { type Target = str; fn deref<'a>(&'a se


Higher ranked lifetimes cannot cross type boundaries | This currently does not compile: ``` rust struct Message<'a> { data: &'a u32, } struct Handler<T>(Option<Box<Fn(T)>>); struct Cfg { handler: for<'a> Handler<Message<'a>>, // error: `Handler` is not a trait [E0404] } ``` This precludes a lot of useful patterns. | labels: A-lifetimes


Ask for bringing back the `std::rt::unwind::try` | Since Rust does not have officially support coroutines, so I attempted to made several crates that supports coroutine scheduling and non-blocking I/O. - https://github.com/rustcc/coroutine-rs - https://github.com/zonyitoo/coio-rs - https://github.com/zonyitoo/simplesched But thes


LLVM loop optimization can make safe programs crash | The following snippet crashes when compiled in release mode on current stable, beta and nightly: ``` rust enum Null {} fn foo() -> Null { loop { } } fn create_null() -> Null { let n = foo(); let mut i = 0; while i < 100 { i += 1; } return n; } fn use_null(n: Null) -> ! { match n  | labels: A-LLVM, P-medium, I-needs-decision, T-compiler, I-unsound, E-medium


Failed to build with rodio | When trying to build my simple file with rodio i get this error: ``` thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/trans/datum.rs:767 ``` And it was caused by: ``` Caused by: Process didn't exit successful | labels: I-ICE


Proper tab stops for preformatted text | Currently we advance by eight spaces for each tab character ('\t', U+0009) in preformatted text: https://github.com/servo/servo/blob/master/components/gfx/text/shaping/harfbuzz.rs#L514 Instead, tabs should advance to the next multiple of the tab-stop width: > All tabs (U+0009) ar


--emit dep-info should support emitting "phony" dependencies for input files | Running something like: ``` rustc --emit dep-info -o x.o lib.rs ``` will produce a depfile containing a rule like: ``` x.o: /path/to/lib.rs /path/to/a.rs /path/to/b.rs ``` This output has a problem: if `a.rs` is deleted from the filesystem and dependencies on it erased from `lib.


Intermittent borrow checker bug | Yay for non-determinism: ``` ../src/librustc/middle/expr_use_visitor.rs:283:9: 287:10 error: cannot infer an appropriate lifetime for lifetime parameter `'tcx` due to conflicting requirements ../src/librustc/middle/expr_use_visitor.rs:283 ExprUseVisitor { ../src/librustc/middle/e | labels: A-borrow-checker, T-compiler


Add high level summary at the top of crates/modules in the book | [crates and modules](http://doc.rust-lang.org/nightly/book/crates-and-modules.html) has a lot of info which is buried deep in the text. It'd be good to have a few major points that the text covers highlighted at the top, perhaps with bullet points or something. - The crate is the


does extern keyword actually affect a function's calling convention? | According to [the Book](https://doc.rust-lang.org/stable/book/rust-inside-other-languages.html#a-rust-library) > The pub means that this function should be callable from outside of this module, and the extern says that it should be able to be called from C. That’s it! Not a whole


std::fs::OpenOptions::mode() is affected by the current umask | Just what it says on the tin. I'm not sure if this is intentional, but if it is, there should definitely be a way to open a file with an unmasked mode. `rustc --version --verbose`: ``` rustc 1.3.0 binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-apple-darwin r


libsyntax/librustc_front: Some visitor methods don't have access to span information | Namely: ``` visit_struct_def visit_enum_def visit_generics visit_arm (can use span of inner Expr, but it's bad) ``` \+ maybe ``` visit_trait_ref (can use span of inner Path, acceptable) visit_ty_param_bound (can use span of inner Lifetime or PolyTraitRef, acceptable) visit_lifeti


Compiler panic when taking the pointer of a static mut variable | I'm trying to reproduce [this bit of C code](https://gist.githubusercontent.com/Snaipe/db898ece69435f88760c/raw/a7aaf63021b42dad836dc4ee76316722b046e1ac/goal.c) into [Rust](https://gist.githubusercontent.com/Snaipe/db898ece69435f88760c/raw/a7aaf63021b42dad836dc4ee76316722b046e1ac | labels: I-ICE


Toggle stack unwinding without printing error message | Is it possible to toggle stack unwinding without printing error message to stderr? I am working on a coroutine library and I want to manually unwind the stack when destroying coroutines. But now I could only use `panic!` to do the trick.


Guidance on writing code that deadlocks for Dining Philosophers | Is it possible to compile code that deadlocks in Rust? I'm trying to break the [Dining Philosophers](https://doc.rust-lang.org/book/dining-philosophers.html) code and get it to deadlock but I can't seem to get it to freeze up. I've tried switching the forks of the last philosophe


Compiler segfaults when boxing a ZST from an external crate | # Demonstration I uploaded a repo with the simplest possible case I could come up with that demonstrates this issue [here](https://github.com/kylewlacy/rust-segfault). Here's how it works: ``` sh $ rustc --version --verbose rustc 1.4.0-dev (d2e13e822 2015-09-15) binary: rustc com | labels: I-ICE


There should be a Box<Error+Send+Sync> -> Box<Error> From conversion | This conversion is done implicitly, but implicit conversions aren't done in generic lookup. This means that ``` rust fn foo() -> Result<(), Box<Error + Send + Sync>> { try!(Err("foo")) } fn bar() -> Result<(), Box<Error>> { try!(foo()); } ``` will fail, which is obnoxious and mea


Possible wrong "value assigned to `something` is never read" warning | I learning rust and write my own simple macros. (This macros just fills my matrix like vec! fills Vec<T>) ``` #[derive(Debug)] struct MatrixXf { rows: usize, cols: usize, values: Vec<f32> } macro_rules! mat { [ $($( $x: expr ),*);* ] => {{ let mut tmp_vec = Vec::new(); let mut ro | labels: A-macros


Unexpected behaviour of std::convert::From | I've confused by this: ``` rust use std::convert::From; pub trait MyFrom<T> { fn from(T) -> Self; } enum Chameleon { Red, Green, Blue } // This works impl MyFrom<Chameleon> for Chameleon { fn from(h: Chameleon) -> Chameleon { h } } // But this doesn't! // error: conflicting imple


effect checking should really be using `expr_ty_adjusted` | Reproduced on: `rustc 1.5.0-nightly (6108e8c3e 2015-09-28)` ``` Rust unsafe fn blow_up() { *(0xcccccccc as *mut u8) = 0; } fn main() { (&blow_up)(); } ``` | labels: I-unsound


Wrapping expr in curly braces changes the operator precedence | [This program](http://is.gd/rdq1jt) prints different values depending upon whether the `v1` or `v2` initializer is surrounded by curly braces: ``` rust fn main() { let v1 = { 1 + {2} * {3} }; // 9, indicating a parse of (1 + 2) * 3 let v2 = 1 + {2} * {3} ; // 7, indicating a pars | labels: A-parser, P-medium, T-lang, T-compiler


Parsing inconsistencies (lambda, proc, return) | I found more inconsistencies between `rustc` and `parser-lalr`. I also noticed that Rust allows return expressions and lambda expressions to end with a struct literal, even when they're in a nostruct context. This seems inconsistent to me. Lambdas (the two parsers disagree): ```  | labels: E-easy, A-parser, P-low, T-lang, T-compiler, C-bug


Unloading a Rust dylib with TLS used segfaults on OSX | [Example code](https://gist.github.com/overdrivenpotato/cdbd413085792c012190) The problem here is that we register a TLS destructor via `_tlv_atexit` when TLS is referenced the first time after it is used (e.g. when the dylib's function is called), but then when `dlclose` happens | labels: O-macos, A-thread-locals, C-bug


Tracking issue for FnBox() | This is a tracking issue for the `fn_box` feature and `FnBox` trait, which allows a `Box<FnOnce(...) -> _>` closure to be invoked via the `"rust-call"` sugar. I'm not sure what the primary concerns are. All I know is it'd be really, really nice if we could invoke a `Box<FnOnce()> | labels: T-lang, T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close


Linker Error on nightly msvc 32bit, maybe related to FnBox | On rustc says rustc 1.5.0-nightly (f5a015892 2015-10-01) Demo project: https://github.com/kosta/fnbox-test When I do `cd fnbox_main; cargo run` on Mac OS (same nightly as be), it says: ``` Running `target/debug/test-fnbox` 3 + 2 = Ok(5) ``` When I do the same on Windows 7 64bit u


Hidden type shows up in rustdoc | On https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html and other pages, one might find implementors such as: ``` rust impl Ord for Big32x36 impl Ord for Big8x3 ``` But these types are not exported and should be hidden from the documentation. | labels: T-rustdoc


Regression in type inference of casting in constants | This works in stable, beta and nightly: ``` rust let x: *mut () = (0 as *const usize) as *const _ as *mut _; ``` This only works in stable: ``` rust const x: *mut () = (0 as *const usize) as *const _ as *mut _; ``` But in beta and nightly results in: ``` <anon>:2:47: 2:55 error:  | labels: T-compiler


Unclear description in closure section of Rust Book | The first section on https://doc.rust-lang.org/stable/book/closures.html can be difficult to understand for novice programmers, particularly the line "Anonymous functions that have an associated environment are called ‘closures’, because they close over an environment." It's diff


improper_ctypes ICE: ast_ty_to_ty_cache was incomplete after typeck! | [playpen repro](http://is.gd/w76hjp) ``` rust extern { fn f(_: &(::std::any::Any + Send)); } fn main() { } ``` ``` error: internal compiler error: unexpected panic thread 'rustc' panicked at 'ast_ty_to_ty_cache was incomplete after typeck!', ../src/librustc_lint/types.rs:391 stac | labels: I-ICE


associated constants should support references to outer type parameters | associated constants should support references to outer type parameters Here is an example, adapted from the `Zeroable` trait from `core::non_zero` ([playpen](http://is.gd/hf1VIN)): ``` rust #![feature(associated_consts)] trait Zble { const Z: Self; } impl Zble for i32 { const Z: | labels: A-resolve, P-medium, A-associated-items, T-compiler


Audit iterator specializations for side effects | After some discussion about https://github.com/rust-lang/rust/pull/28125 the libs subteam decided that iterator adaptors should always preserve the same semantics in terms of the convenience methods and such. This was not audited for when all the initial specializations landed, s | labels: P-medium, T-libs-api


const fn with `_` as an arg name vomits | ## Doesn't work: ``` rust #![feature(const_fn)] fn main(){} const fn size_ofs(_: usize) { } ``` ``` <anon>:3:19: 3:20 error: arguments of constant functions can only be immutable by-value bindings [E0022] <anon>:3 const fn size_ofs(_: usize) { } ^ <anon>:3:19: 3:20 help: see the  | labels: E-easy, E-mentor, A-const-eval


Macro designators listed but not explained | In https://doc.rust-lang.org/reference.html#macro-by-example the various designators available for macro construction are listed, but they are not explained. The closest I could find was https://danielkeep.github.io/practical-intro-to-macros.html: ![Macro designators](https://clo | labels: A-macros


Associated types are not correctly computed (at least not at the right time) | If I have an associated type that impls some trait or is some other known type, I can't treat it as so. Example ([playpen link](http://is.gd/he7Phw)): ``` rust trait DoNothing { type Output; } struct Bob; impl Bob { fn print() { println!("I AM BOB!"); } } impl DoNothing for Bob { | labels: A-associated-items


Build fails against LLVM 3.7.0 | Broken by 27dd6dd3dbe92debaac7d54c8405a3d3af1c4daf in #28500. ``` /home/wthrowe/computing/rust/src/rustllvm/RustWrapper.cpp: In function ‘LLVMOpaqueValue* LLVMRustBuildLandingPad(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef, unsigned int, const char*, LLVMValueRef)’: /home/wthrowe/c | labels: A-LLVM


Shouldn't the book be in a separate repo ? | I think that with this separation we could make the book more like the progit2 book and so make it more easy translate it in various languages


Avoid use of 'just' in trpl | Hi! I'm just reading through The Rust Programming Language Book (TRPL) and I noticed usage of the word 'just' a few times: "e.g. just install this thing". I've written a bit on this word but to keep it short; I feel that this is quite a loaded word and we could do better without


Error "binary operation `==` cannot be applied to type" -> print note that PartialEq might be missing | The error ``` <std macros>:5:8: 5:18 error: binary operation `==` cannot be applied to type `core::result::Result<collections::string::String, MyError>` [E0369] <std macros>:5 if ! ( * left_val == * right_val ) { ^~~~~~~~~~ src\lib.rs:34:3: 34:41 note: in this expansion of assert | labels: A-diagnostics


Cannot find serialize documentation. | There seems to be link rot in online api docs for `serialize::json`. Through various searches on google, duckduckgo, and from blocks and pages like [this stack overflow answer](http://stackoverflow.com/a/26337102) I go to the following URL: - http://doc.rust-lang.org/serialize/in


How to extract static reference from Option? | I have a `static Option<&'static mut Foo>` and I want to get the reference out of it. I know this is unsafe, but I can't seem to be able to figure out how to do this. First I tried this: ``` pub trait Foo { } static mut _foo: Option<&'static mut Foo> = None; pub fn get_foo() -> & | labels: regression-from-stable-to-nightly, P-high, T-lang


Build fails on Windows/MSYS2 | Your Windows build instructions are out of date. First of all, the set of commands doesn't install GCC, so that has to be done separately. But even after that, there are plenty of issues that prevent compilation. Please verify compilation on Windows and update the build instructi | labels: O-windows


ICE from macro invocation with empty comment | [Playpen link](http://is.gd/udtdjR) ``` rust fn main() { println!(/**/); } ``` Output: ``` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/mast


Inherent static methods can be called with a non-well-formed Self-type | **UPDATE:** This has been fixed, but a test is still needed. [See the comment below for instructions.](https://github.com/rust-lang/rust/issues/28848#issuecomment-294848720) ------- ## STR ``` Rust struct Foo<'a, 'b: 'a>(&'a &'b ()); impl<'a, 'b> Foo<'a, 'b> { fn xmute(a: &'b ()) | labels: E-easy, A-type-system, E-needs-test, E-mentor


Allocator inconsistency between bin and dylib | I recently had a problem with a dylib causing a segfault when triggering drop in an object passed to it from a rust binary. jethrogb on the #rust irc channel found out that rustc build the dylib with alloc_system and the binary with alloc_jemalloc leading to all kinds of memory p


four-byte uncode characters confuse `'` | This Rust program: ``` fn main() { let len = 'ஶ்ரீ'.len_utf8(); } ``` contains `TAMIL SYLLABLE SHRII (śrī)`, aka `U+0BB6 U+0BCD U+0BB0 U+0BC0`. When trying to compile this program, I get this error: ``` text 2:20: 2:22 error: unterminated character constant: '. 2 let len = 'ஶ்ரீ' | labels: A-diagnostics


#28669 caused regression compiling pinyin crate on nightly | See https://tools.taskcluster.net/task-inspector/#UFk2m1UJRweSxQNABRB84w/0 ; I've confirmed the issue locally, although I haven't managed to reduce it. For reference, the error message: ``` Compiling pinyin v0.0.4 (file:///home/crate) src/lib.rs:157:24: 157:29 error: cannot infer | labels: P-high, T-libs-api, regression-from-stable-to-beta


Nightly regression: lifetime error with autoderef | Testcase: ``` rust use std::collections::HashMap; pub fn named_lints<'a>(names: &[&str], transforms: &'a HashMap<&'static str, u32>) -> Option<&'a u32> { transforms.get(&names[0]) } fn main(){} ``` ``` <anon>:5:20: 5:29 error: cannot infer an appropriate lifetime due to conflicti | labels: regression-from-stable-to-nightly, P-high, T-compiler


unsupported target triples | Running a NetBSD instance on AWS 6.1.5 Just did a new git clone - After running the ./configure receiving an unsupported target triples "x86_64-unknown-netbsd" found here is the error in its entirety ``` configure: looking for configure programs configure: found program 'cmp' con


Rustdoc doesn’t expand macros properly when generating docs | I have defined a macro to bind constants: ``` rust #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct Const(pub i32); macro_rules! bind_constant { ($NAME:ident, $value:expr) => { pub const $NAME: Const = Const($value); } } bind_constant!(A, 10i32); bind_constant!(B, 20i32);  | labels: T-rustdoc


Book contradicts itself | In chapter [2.3 Dining Philosophers](https://doc.rust-lang.org/book/dining-philosophers.html) the `map` function is used to call a closure for every philosopher. The closure however is only executed for its side effects (it doesn't actually calculate anything). The chapter on [it


Multiple extern fn with same name should not error out | See https://github.com/rust-lang/rust/issues/16403#issuecomment-66864518 and that issue in general. Currently for each `extern fn` we generate a rust ABI function containing function body and a `C` ABI trampoline to the rust function. However we do not mangle the rust ABI functio


Associated type regression? unable to infer enough type information about `_` | rustc seems to accept this under stable, but not beta or nightly. [playpen repro](http://is.gd/uijdR8) ``` rust trait T { type T; } struct S; impl T for S { type T = S; } trait T2 { type T: Iterator<Item=<S as T>::T>; } ``` ``` error: unable to infer enough type information about | labels: A-associated-items, regression-from-stable-to-beta


cargo new --vcs git doesn't init a branch, if alread inside a tree | I was slightly surprised by this: ``` % cd /tmp % git init a Initialized empty Git repository in /private/tmp/a/.git/ % cd a/ % cargo new --vcs git -v --bin b % ls -a b . .. Cargo.toml src ``` Perhaps this is working as intended but I would have liked at least a warning.


Possibly-incorrect coherence error with blanket impl bounded by a trait with type param | This fails to compile: ``` rust trait Base<X> {} trait Foo<X> {} impl<X, T: Base<X>> Foo<X> for T {} struct Bar<T>(T); impl<T> Foo<T> for Bar<T> {} fn main() {} ``` ``` <anon>:4:1: 4:36 error: conflicting implementations for trait `Foo` [E0119] <anon>:4 impl<X, T: Base<X>> Foo<X> | labels: A-trait-system, T-lang


Guide:mismatched types ->E0380 when cargo run in guess_game | i wrote the code ,but error occured when cargo run,this error is :mismatched types E0380,i know why this occured,because rust book have tell me,the point is :why i wrote code as like rust book,it can't cargo run success? i wrote this code follow the example: let guess: u32 = gues


Add style to rustdoc/rustbook | I'm working to add a dark theme on both rustbook and rustdoc. I'll also add a list to allow switching between styles without impacting the global interface. cc @steveklabnik | labels: T-rustdoc


Spanning algorithm assumes all codepoints have width equal to 1 | ``` /tmp/test.rs:2:23: 2:23 error: invalid unicode character escape /tmp/test.rs:2 let a = "きききききき\u{}"; ^ /tmp/test.rs:3:37: 3:37 error: invalid unicode character escape /tmp/test.rs:3 let a = "ōōōōōōōōōō\u{}"; ^ error: aborting due to 2 previous errors ``` the first e


Inadequate error handling in make_place(). | Currently the only way to handle failed pointer creation when making a place is to panic, like IntermediateBox does. For some use cases, panicking is unacceptable. There needs to be a way to indicate that it is impossible to allocate an object into a container without crashing th


bogus span with iterator adapter chain | Playpen: https://play.rust-lang.org/?gist=aca803a41435a13b5a72&version=nightly Something is wrong with the error here. The call to `map` is wrong, but the error refers to `filter`. | labels: A-diagnostics


LLVM lint: Memory reference address is misaligned | This is a subissue of #7463. ``` rust pub enum H<A, B> { L(A), R(B), } pub fn test() -> H<i32, i64> { H::L(0) } ``` Compile with `rustc -C passes=lint` and you get: ``` Undefined behavior: Memory reference address is misaligned call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* get | labels: A-LLVM


Improving installation on local directory by updating LD_LIBRARY_PATH | When installing rust in a local directory on linux (not /usr/local but /home/name/rust for example), it is necessary to update LD_LIBRARY_PATH with the path to the rust libraries. For example, in bash: > export LD_LIBRARY_PATH="/path/to/library":$LD_LIBRARY_PATH An improvement of


Illegal instruction when building rust 1.3 on Debian 8 Jessie 64bits and using system-wide LLVM 3.5 | When building rust 1.3 on debian Jessie 64-bit **with the LLVM software provided by the distribution**, compilation fails with an illegal instruction error. When rust is built with the bundled LLVM, no error occurs. Rust Build has been configured with : `./configure --prefix=/opt


Link error when cross-compiling to ARM with --crate-type dylib: Relocations in generic ELF (EM: 40) | `rustc lib.rs -g --crate-type dylib --target arm-linux-androideabi` fails with the following error, even if `lib.rs` is an empty file: ``` error: linking with `cc` failed: exit code: 1 note: "cc" "-Wl,--as-needed" "-Wl,--allow-multiple-definition" "-L" "/home/mbrubeck/.servo/rust


rustdoc - panicked at 'Unexpected empty destination: ["dsp"]' - occurs on beta and nightly | Travis [is failing](https://travis-ci.org/RustAudio/dsp-chain/jobs/84483946) when running rustdoc on my dsp crate due to a panic occurring in rustdoc: ``` Compiling dsp-chain v0.7.1 (file:///home/travis/build/RustAudio/dsp-chain) Running `rustdoc src/lib.rs --crate-name dsp -o /h | labels: T-rustdoc


Nightly regression around HRTBs, likely connected to wf changes | The following code: ``` rust struct Parser<'i: 't, 't>(&'i u8, &'t u8); impl<'i, 't> Parser<'i, 't> { fn parse_nested_block<F, T>(&mut self, parse: F) -> Result<T, ()> where for<'tt> F: FnOnce(&mut Parser<'i, 'tt>) -> T { panic!() } fn expect_exhausted(&mut self) -> Result<(), () | labels: A-lifetimes, regression-from-stable-to-nightly, P-high, T-compiler


IndexMut incorrectly chosen instead of Index | ``` rust use std::ops::{Index, IndexMut}; struct S; impl S { fn foo(&self) -> i32 { 0 } } impl Index<usize> for S { type Output = S; fn index(&self, _: usize) -> &S { self } } impl IndexMut<usize> for S { fn index_mut(&mut self, _: usize) -> &mut S { self } } fn main() { let s =  | labels: A-trait-system, E-needs-test, T-lang, A-inference, C-bug


Nightly regression in borrow checker | ``` pub type Session = i32; pub struct StreamParser<'a, T> { _tokens: T, _session: &'a mut Session, } impl<'a, T> StreamParser<'a, T> { pub fn thing(&mut self) -> bool { true } } pub fn parse_stream<T: Iterator<Item=i32>, U, F>( _session: &mut Session, _tokens: T, _f: F) -> U whe | labels: A-lifetimes, E-needs-test, P-low, T-compiler


Tracking issue for Allow a re-export for `main` (RFC 1260) | RFC Thread: https://github.com/rust-lang/rfcs/pull/1260 Feature name: `imported_main` ### Steps / History - [x] Implementation: - [x] Support imported main from same crate (#84401) - [x] Support imported main from foreign crate (#84507) - [x] Final commenting period (FCP) (https: | labels: A-codegen, A-resolve, B-RFC-approved, T-lang, relnotes, B-RFC-implemented


Build Failed. | I am trying to install rust on a supercomputer. This is why x86_64-unknown-linux-gnu. ``` link: x86_64-unknown-linux-gnu/rt/librustllvm.a rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm rustc: x86_64-unknown-linux-gnu/stage0/lib/rustl


`env::home_dir()` should use `SHGetKnownFolderPath()` on windows. | At the moment, it first looks at `%HOME%`, and then at `%USERPROFILE%`. This is bad for two reasons: 1) The home directory will be different when run from an msys or cygwin terminal. Unless the program is specifically compiled to run in an msys/cygwin environment (they have their | labels: O-windows, T-libs-api, C-feature-accepted


Add an exit_crate(..) callback to LateLintPass | I [had to](https://llogiq.github.io/2015/10/09/lint-data.html) resort to implement `Visitor` for my lint so I could do something _after_ having walked the whole crate. This hurts performance for something that could easily be done by having an `exit_crate(self, cx: &LateContext,  | labels: T-compiler


Adding more information can make type inference fail. | I think the case is best illustrated by an example: ``` rust fn test() -> Vec<u8> { let result = Some(5).into_iter().collect(); // Introducing any of the commented out lines will make type inference fail. // &*result; // result.clone(); // &result[..]; result } ``` Note that addi


Expected location of #![feature(...)] is not obvious | I added the augmented_assignments feature to the [file I was working on](https://gist.github.com/absoludity/37ac14dd6abb7fe2470b), but when testing, the compiler complained: ``` error: overloaded augmented assignments are not stable help: add #![feature(augmented_assignments)] to | labels: A-diagnostics


ICE "thread 'rustc' has overflowed its stack" on Windows (1.5 nightly x86_64 msvc toolchain) | I've got the following trait and impl: ``` rust pub trait Dot<Other=Self> { type Output; fn dot(self, rhs: Other) -> Self::Output; } impl<'a, T> Dot<&'a T> for T where T: Dot<T> + Copy { type Output = T::Output; fn dot(self, rhs: &T) -> Self::Output { self.dot(*rhs) } } ``` When  | labels: I-ICE, E-needs-test, C-bug


rustc produces invalid IR with -O -g | When compiling rustc with "--enable-debug --enable-optimize" the stage0 compiler fails to build libsyntax with ``` !dbg attachment points at wrong subprogram for function !157085 = !DISubprogram(name: "fnfn", linkageName: "fnfn", scope: !157069, file: !157069, line: 38, type: !42 | labels: A-debuginfo, P-medium, T-compiler


vec! macro should use box [...] instead of Box::new([...]). | There's no reason to have the potentially unoptimizable inefficiency in `vec!`. It's impossible to reoder side-effects (which is why we want placement syntax), so `vec![expressions, containing, side, effects]` will end up in a copy from the stack to the heap. I guess it's not as


Begin exercising rustc's right to reorder struct fields for optimal padding | The representation of structs that are not tagged with a repr attribute is currently and deliberately undefined, in order to allow us to optimize the representation to automatically reduce memory usage due to excess padding (as described in http://www.catb.org/esr/structure-packi


Optimize enum layout | See https://github.com/rust-lang/rust/issues/20638, which was vandalised and seemingly never reopened (?)


give a specific error message for the wrong return type | This can be confusing for people new to rust and perhaps trying to copy some example code from https://doc.rust-lang.org/std/fs/struct.File.html: ``` rust use std::fs::File; fn main() { let mut f = try!(File::create("foo.txt")); } ``` https://play.rust-lang.org/?gist=2201429be6f0


TcpStream::read receives 0 bytes on Mac OS 10.10.5 | It appears TcpStream::read receives 0 bytes and returns immediately on both stable (1.3.0) and nightly despite not reaching EOF. It doesn't matter whether or not I set a read timeout, either. I tested with both nightly and stable, as well as with and without a read timeout (on ni


Allow "blessed" libraries to be used via `extern crate` from play.rust-lang.org | One of the biggest unspoken advantages of being in the stdlib is that it's trivial to provide a working example of their usage thanks to their inclusion on play.rust-lang.org. While I _suppose_ we could finagle a way to have every library that's on crates.io available from the pl


Make the mouseover clickable link for rustdoc code more visible | The linkable icon is difficult to [notice](https://www.reddit.com/r/rust/comments/3o91cf/a_beginners_thoughts/cvv3fa9). I'm playing with this currently. I'm toying with trying to change the icon from unicode into a svg because unicode has a weird box border shape that doesn't all


Modification of playpen.js doesn't rebuild rust docs | STR: 1. Modify https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/static/playpen.js 2. `make && make docs` Should rebuild the docs with whatever changes but it doesn't. It just says nothing was changed and exits.


Beware of GCC 5.x | Just a heads-up to others: mingw-w64 (not sure about other platforms) GCC 5.x appears to be subtly mis-compiling LLVM, which results in a segmentation fault during rustc's codegen. I've seen this with x86_64-5.1.0- and i686-5.2.0- toolchains. In the former case LLVM had to be com


Tracking Issue for Mutex and RWLock unique accessors | After #29031, this is now the tracking issue for the stabilization of the following features: - [ ] mutex_into_inner - [ ] mutex_get_mut - [ ] rwlock_into_inner - [ ] rwlock_get_mut ## Original report As far as I can tell, it's sound to straight-up-unwrap a Mutex if you have it b | labels: T-libs-api, final-comment-period, B-unstable


Compiler gets lifetime scope wrong | Please check the code bellow https://play.rust-lang.org/?gist=c0dd3d93bde346c4bd4d&version=nightly ``` #![feature(drain)] use std::sync::{Arc, RwLock}; fn main() { let files = RwLock::new(vec![Arc::new(1u32)]); // WONT compile let a: Vec<_> = files.write().unwrap().drain(..1).col | labels: A-lifetimes, A-borrow-checker, C-bug, fixed-by-NLL


ICE after error in associated item resolution | ``` rust enum Foo { Bar(u8) } fn main(){ foo(|| { match Foo::Bar(1) { Foo::Baz(..) => (), //~ ERROR no associated _ => (), } }); } fn foo<F>(f: F) where F: FnMut() { f(); } ``` on `rustc 1.5.0-nightly (9d3e79ad3 2015-10-10)` gives an ICE: ``` rustc on-the-rocks.rs on-the-rocks.rs | labels: I-ICE


Error for unknown variant  talks about associated items | ``` enum Foo { Bar(u8), Baz(u8) } fn main() { match Foo::Bar(1) { Foo::Quux(..) =>(), _ => () } } ``` ([playpen](http://is.gd/HrMVG4)) Currently gives the error message: ``` <anon>:7:9: 7:22 error: no associated item named `Quux` found for type `Foo` in the current scope <anon>:7 | labels: C-enhancement, A-diagnostics, WG-diagnostics


rustc freeze whole system | My system freezes when I try to compile this https://gist.github.com/SCareAngel/9cb3e50c1734d4179fc4 rustc 1.5.0-nightly (e362679bb 2015-10-08) ubuntu-15.04 | labels: A-macros


Command/environment variable interaction is confusing and error-prone | The API which Command exposes implies that environment variables are captured from the parent process at the point where it is constructed, and then may be subsequently modified through the use of `env`/`env_remove`/`env_clear`. However, in reality the environment variables are c | labels: T-libs-api, C-feature-accepted


std::process::Command docs list trait impl for CommandExt twice | https://doc.rust-lang.org/std/process/struct.Command.html#implementations The `impl CommandExt for Command` section is there twice, identically. | labels: T-rustdoc


std::os::unix::fs::MetadataExt::size() silently truncates file size on Android | The implementation of size() looks like this: ``` rust fn size(&self) -> raw::off_t { self.as_raw_stat().st_size as raw::off_t } ``` The field `st_size` has type `c_longlong`, and the type `raw::off_t` has type `i32` on 32-bit Android. The combination doesn't work well. | labels: O-android


Tracking issue for non-ASCII identifiers (feature "non_ascii_idents") | Non-ASCII identifiers are currently feature gated. Handling of them should be fixed and the feature gate removed. | labels: P-low, T-lang, B-unstable, C-tracking-issue


WTF Error Message with `impl<T> Deref for T | Play link: http://is.gd/WYlDGu ``` rust use std::ops::Deref; struct Foo; impl<Foo> Deref for Foo { } fn main() {} ``` Error message: ``` <anon>:5:1: 5:28 error: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined i | labels: A-diagnostics


ICE: using associated types in extern function signature | I get an ICE with similar code to this testcase : (`rustc 1.3.0 (9a92aaf19 2015-09-15)`) ``` rust trait Test { type T; } impl Test for u32 { type T = i32; } pub type I = <u32 as Test>::T; pub extern "C" fn test(t : I) {} ``` trace : ``` thread 'rustc' panicked at 'Box<Any>', ../s


Cannot add prefixes or suffixes to macro-generated function names | If I write a macro intended to generate new functions at compile time, I am able to name the functions according to individual `ident`s, but I cannot annotate or concatenate anything onto the `ident` if I wish. Consider the code below: ``` rust #[macro_export] macro_rules! compon


Enum pattern whose constructor resolves to const should be rejected | I believe the following program should be rejected, but it is accepted (and panics) now. ``` rust const C: i32 = 0; fn main() { if let C(..) = 0 { panic!(); } } ``` | labels: A-parser


HRTB and Associated Types combine to make fn not implement corresponding Fn trait | ``` rust trait LifetimeToType<'a> { type Out; } impl<'a> LifetimeToType<'a> for () { type Out = &'a (); } fn id<'a>(val: &'a ()) -> <() as LifetimeToType<'a>>::Out { val } fn assert_fn<F: for<'a> FnOnce(&'a ()) -> <() as LifetimeToType<'a>>::Out>(_func: F) { } fn main() { assert_ | labels: A-lifetimes, E-needs-test, A-associated-items, T-compiler, C-bug, T-types


FreeBSD implementation of current_exe unnecessarily uses a Vec. | File: `src/libstd/sys/unix/os.rs` Seems like this should be able to use a fixed-length array instead.


Rust book Ownership copy section seems wrong | In the Ownership page, under the Copy Types section, there's this (problematic part bolded): > In this case, v is an i32, which implements the Copy trait. This means that, **just > like a move, when we assign v to v2, a copy of the data is made**. But, unlike a > move, we can sti


Unable to use an exported Rust function inside a `build.rs`-generated library | My Rust lib `test` exports a public symbol, which is in turn used inside a CPP library I build using a custom `build.rs` script. Compiling works fine, until the linker steps in. It complains that the Rust function doesn't exist. **Cargo.toml** ``` toml [package] name = "test" bui


RFC 1214 warning in librustc_mir/repr.rs | Building nightly yields ``` ../rust/src/librustc_mir/repr.rs:404:5: 404:38 warning: the parameter type `V` may not live long enough [E0309] ../rust/src/librustc_mir/repr.rs:404 pub elem: ProjectionElem<'tcx, V>, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../rust/src/librustc_mir/repr.rs:4


Incorrect attribute arguments are silently ignored | This test compiles with no warnings and passes. ``` rust #[test] #[should_panic(exepcted = "foo")] fn foo() { panic!("bar"); } ``` I would expect at least a warning that "exepcted" was unused. | labels: A-attributes


Compiler can't choose an implementation if there are more than one | I've surprised with contradictory compiler's behaviour in the following code: ``` rust trait Extractor<T> { fn extract(&self) -> Option<T>; } struct Container; impl Extractor<String> for Container { fn extract(&self) -> Option<String> { None } } fn expected(_: &str) { } fn main()


PhantomData should implement Clone | I don't see any good reason to prevent it, and this would have saved me lots of manual implementations of `Clone`.


stdlib Path has inconsistent normalisation behaviour | Given: ``` use std::path::{Path, PathBuf}; fn main() { let mut p = PathBuf::from("/a/b/c"); println!("{:?} {:?}", p, p.file_name()); p.push(""); println!("{:?} {:?}", p, p.file_name()); p.push(""); println!("{:?} {:?}", p, p.file_name()); p.pop(); println!("{:?} {:?}", p, p.file_ | labels: P-medium, T-libs-api, E-medium, A-docs, C-bug


Indexed and IndexedMut traits only accept usize | Sample code: https://play.rust-lang.org/?gist=b9b0fad33060c74095a0&version=nightly Short sample code that fails to compile: ``` rust let a = [0;5]; let x = a[0u8]; ``` I'm working on a native Rust implementation of the Google Brotli compression algorithm (https://github.com/peter


Book at docs.rust-lang.org behind master. Continuous deployment for docs? | There have been some helpful doc updates recently that aren't reflected at https://doc.rust-lang.org/stable/book, such as https://github.com/rust-lang/rust/commit/bcf3921a2aaf72c0f7a3e052dd2ef20f188054a3 by @mike-marcacci from August 8. I think it would be worth considering a CI


RawVec of ZST should be safe to transmute | `RawVec` currently stores its buffer capacity not in bytes but as the number of elements that fit in it. That makes transmute as unsafe to use on it as on any other data structure. If `RawVec` would store the capacity as the size of the buffer in bytes, that would mean that `mem:


Static method impls specialized for concrete phantom types invisible to other crates | Let there be a crate consisting of the following short code snippet: ``` rust use std::marker::PhantomData; pub struct Foo; pub struct Bar; pub struct Baz<T> { _t: PhantomData<T>, } impl Baz<Foo> { pub fn new() -> Baz<Foo> { Baz { _t: PhantomData } } } impl Baz<Bar> { pub fn new( | labels: A-resolve


Illegal instruction while building Rust 1.3 llvmdeps.rs on Gentoo x86_64 with bundled LLVM. | USE flags: ``` [ebuild N ~] dev-lang/rust-1.3.0:stable::gentoo USE="-clang -debug -doc -libcxx" 0 KiB ``` GCC: ``` Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/lto-wrapper Target: x86_6


Internal compiler error upon deriving Debug for a generic type T with a default type argument that depends on T's lifetime parameter | When you attempt to derive `Debug` for some `T<'a, U: 'a = V<'a>>`, the compiler throws `Type parameter out of range when substituting in region 'a`. See [this playpen](http://is.gd/sxm1wS). Note that this works fine on beta and nightly; perhaps this would make a good regression  | labels: E-needs-test


Stability attributes are required for some inaccessible items | ``` #![feature(staged_api)] #![staged_api] #[stable(feature="test", since="1.0.0")] pub const C: u8 = {pub struct S; 1 }; #[stable(feature="test", since="1.0.0")] pub type T = [u8; { pub struct S; 1 }]; fn main() {} <anon>:8:20: 8:33 error: This node does not have a stability att | labels: A-stability


Arc is invariant in its type parameter | I would expect it to be covariant. This seems to be an unintentional side-effect of using `*mut` internally. ## Code [Playground](http://is.gd/ABTDhS) ``` rust use std::sync::Arc; fn works<'r>(x: Box<&'static str>) -> Box<&'r str> { x } fn also_works<'r,'w>(x: &'w &'static str) -


Thread-safe clone provider | Consider a structure `Foo`, which implements `Clone` for sharing between threads but not `Sync`. For instance, any structure containing a `Sender`. The best way to share a `Foo` is therefore to have a local instance instantiated explicitly somewhere on the stack, and to lug it ar


Parsing "+" or "-" to f32/f64 on nightly | I tried this code: ``` match "+".parse::<f32>() { Ok(v) => println!("f32 OK: {}", v), Err(e) => println!("f32 Error: {}", e) } match "-".parse::<f64>() { Ok(v) => println!("f64 OK: {}", v), Err(e) => println!("f64 Error: {}", e) } ``` I expected to see this happen: "Error: invali | labels: regression-from-stable-to-beta


Confusing error message calling indirect function pointer | Hi, When compiling this code ``` Rust extern crate libc; #[repr(C)] pub struct ApiFromC { some_data: *mut libc::c_void, some_function: extern fn(data: *mut libc::c_void), } struct RustAPI { api_from_c: *mut ApiFromC, } impl RustAPI { fn call_c_api(&self) { unsafe { (*self.api_fro | labels: A-diagnostics


Nightly regression: Incorrect "parameter type may not live long enough" warning | Testcase: ``` rust use std::marker::PhantomData; pub struct WebDriverHttpApi<U> { _routes: PhantomData<U>, } impl <U> WebDriverHttpApi<U> { pub fn new(extension_routes:Vec<(&str, U)>) -> WebDriverHttpApi<U> { for &(ref _url, ref _extension_route) in extension_routes.iter() {} uni | labels: A-lifetimes, regression-from-stable-to-nightly, P-high, T-lang, T-compiler


Perhaps document breaking changes better | Now that breaking changes are much more rare, and preceded by long discussion of how the breakage can be worked around, it may be worthwhile to provide a single document that lists: - Summary of the change. - Information that helps you identify that it is indeed _this_ change tha


ICE when installing Rust 1.3.0 on El Capitano via homebrew | Error is: ``` Compiling crates-io v0.1.0 (file:///private/tmp/rust--cargo20151014-72976-7pfg6i) error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob | labels: I-ICE


Unsoundness in borrowck around deref and mutable refs | Stable and nightly happily compile the following: ``` rust fn main() { let x: &'static str = "x"; { let y = "y".to_string(); let ref mut x = &*x; *x = &*y; } println!("{:?}", x); } ``` Running the program on my local Ubuntu machine yields: ``` thread '<main>' panicked at 'index 0 | labels: E-easy, E-needs-test, P-medium, T-compiler, A-MIR, I-unsound


Traits are not implemented for functions with higher-ranked lifetime bounds | Also the error is really confusing, because the compiler omits the troublesome bound in the error message. ``` rust trait IsClone: Clone {} impl IsClone for fn(&()) {} //~^ error: the trait `core::clone::Clone` is not implemented for the type `fn(&())` impl IsClone for for<'a> fn


Using enum with trait causes crash | The following code ``` rust trait U {} enum T { Data(U) } fn f(t: &T) {} fn main() {} ``` causes a crash: ``` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust- | labels: I-ICE


[Docs] Terminology inconsistency between 'iterator adapters' and 'iterator adaptors' | ## Context After having first read about iterators the TRPL book, it called my attention the scarce number of matching results in the API docs for a query like "iterator adapters". Curiously enough, it looks like the term used there is "adaptors" instead of adapters. ## Data - Ap


dead_code false positive on matched enum | [This code](http://is.gd/17G7yv) produces a dead code warning for the entire enum, but it isn't dead because the match expression refers to it. Or do I have the wrong definition of "dead"? (I generally assume when rustc says "this is dead" it means "you can comment this out".) `` | labels: A-lints


Allow pub access to underlying 'Read' member of Take or Chain | I asked this as [a question on StackOverflow](http://stackoverflow.com/questions/33114619/access-to-components-of-a-read-wrapped-by-take-or-chain), and it was suggested that I raise an issue. I'm writing a Rust implementation of the Google Brotli decompression algorithm, which us | labels: T-libs-api, E-help-wanted


Parsing inconsistencies with semi-statements in expressions | ``` x = if true { 10u32 } else { 20u32 } as () ``` parses as ``` x = (if true { 10u32 } else { 20u32 } as ()) ``` but ``` if true { 10u32 } else { 20u32 } as () ``` parses as ``` if true { 10u32 } else { 20u32 }; as () ```


Arithmetic operation overflowed in rustc_trans::trans::cabi_x86_64 | I'm getting an "arithmetic operation overflowed" ICE in librustc_trans/trans/cabi_x86_64.rs on line 454 when building stage1 libstd on 64-bit Ubuntu. Likely related to #27017.


doc/style/changing directory is outdated. | The directory https://github.com/rust-lang/rust/tree/master/src/doc/style/changing has a pre-1.0 page attached to it, and the post-1.0 page talks about higher kinded types. Given that nobody's mentioned this yet, I don't think this chapter of the style guide is even useful, and s


calling `std::mem::drop` on a `Copy`-struct should give a warning | Currently [code like this](http://is.gd/cICPIS) ``` rust fn main() { let i = 3; for _ in 0..10 { println!("{}", i); std::mem::drop(i); } } ``` compiles without any warnings. What's happening, is that a copy of the object gets passed into std::mem::drop. I'd doubt this could be th | labels: A-lints


ICE: "unprintable span" with macro and two files, no backtrace | Compiling the following two files results in an ICE without a backtrace: - lib.rs: ``` rust macro_rules! foo { ($d:expr) => {{ fn bar(d: u8) { } bar(&mut $d); }} } mod m; ``` - m.rs: ``` rust fn f() { foo!(0u8); } ``` Compiled with the command: `rustc lib.rs --crate-type lib` Res | labels: I-ICE


Confusing error message for non-ASCII byte literals | Playpen: http://is.gd/DB2ZBU Code like `b'→'` that puts a unicode character in a byte literal gets a confusing error message: ``` <anon>:2:7: 2:8 error: byte constant must be ASCII. Use a \xHH escape for a non-ASCII byte: \u{2192} <anon>:2 b'→' ^ ``` A lot of people read this as  | labels: A-diagnostics


Segfault in a compiler-generated Drop impl | I've tried reducing this code in various ways, and unfortunately the original seems to already be the smallest that fails! Removing variants from `Term` causes it to not exhibit itself, as does removing cases from the outer `match` in `small_eval`. It reproduces on latest nightly | labels: I-crash, A-codegen


Global const expr with macro causes compiler panic | I would like to have compile-time evaluation of my const values from the environment variables. I wonder whether I had some grammar mistakes, however the compiler panics. This occurs all stable, beta, and nightly versions (from play.rust-lang.org). I tried this code: ``` const DE | labels: I-ICE, T-compiler


Ambiguous elided lifetime error claims non-elided lifetime is elided | ``` rust struct Thing<'a>(&'a ()); fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() } fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() } ``` gives ``` test.rs:3:34: 3:37 error: missing lifetime specifier [E0106] test.rs:3 fn func1<'a>(_arg: &'a Thing) -> &() { unim | labels: C-enhancement, A-diagnostics


Incorrect shadowed label warnings | This may be a byproduct of not having non-lexical lifetimes, but this code generates a bunch of shadowed label warnings that are not accurate (control is not within the block of the allegedly shadowed label at the point the new label is declared): ``` match 0 { 0 => { 'quux: loop | labels: A-diagnostics


Shadowed label warning should be a hardwired lint | There's no way to turn off the shadowed label warning: http://is.gd/0e3wQf. We should add a `SHADOWED_LABEL` lint to [builtin.rs](https://github.com/rust-lang/rust/blob/293966694c3c8e0c7028e8f54340fbc328d85bff/src/librustc/lint/builtin.rs), and convert the `span_warn` [here](http | labels: A-lints


impl default type param fallback not firing without explicitly typed expression context | One of the big motivations for default type parameter fallback ([RFC #213](https://github.com/rust-lang/rfcs/blob/master/text/0213-defaulted-type-params.md)) was for future-proofing our API's: We wanted to be able to stabilize an api like `Vec<T>`, with the expectation that futur


Nightly borrowck regression | The following code compiles on stable and beta but not on the current nightly: ``` rust #[derive(Clone)] struct S; impl S { fn borrow(&self) -> Vec<&Self> { vec![self] } fn borrow_mut(&mut self, _: &S) { } } fn main() { let mut s = S; for x in s.borrow().into_iter().cloned().coll | labels: regression-from-stable-to-nightly, P-high, T-compiler


`Arc` and `Rc` are dropck-unsound | ``` rust use std::sync::Arc; struct Foo<'a>(&'a String); impl<'a> Drop for Foo<'a> { fn drop(&mut self) { println!("{:?}", self.0); } } fn main() { let (y, x); x = "alive".to_string(); y = Arc::new(Foo(&x)); } ``` Output after compiling with `rustc 1.5.0-nightly (6cdf31b12 2015-1 | labels: T-libs-api


unsafe const fn declaration order | The [recent implementation](https://github.com/rust-lang/rust/pull/28827#issuecomment-148083432) uses the syntax `unsafe const fn`, but the RFC says `const unsafe fn`. | labels: A-parser, T-lang


extern "Rust" causes ICE | I tried this code ``` Rust extern "Rust" { fn foo(); } pub extern fn bar() { unsafe { foo(); } } ``` I get this error back ``` error: internal compiler error: unimplemented foreign functions with Rust ABI note: the compiler unexpectedly panicked. this is a bug. note: we would app | labels: I-ICE


ICE in stable `1.3.0` - ERROR:rbml::reader: failed to find block with tag 37 | The ICE occurs when I `cargo build` a personal project. Here's the stack trace: ``` Compiling timeline v0.1.0 (file:///Users/Mitch/Programming/Rust/jen/timeline) ERROR:rbml::reader: failed to find block with tag 37 error: internal compiler error: unexpected panic note: the compil


Bad span for expression literal in match arm | The span assigned to the _expression_ `10` in ``` rust match x { 10 => 20, _ => 25, } ``` is `10 =>`, where one would expect it to be `10`. The _pattern_ `10` is correctly assigned the span `10`.


Hint when using a static method on an instance is wrong | I wrote `Box::new(telemetry_t::new()).into_raw()` and got this output: ``` src/lib.rs:41:34: 41:44 error: no method named `into_raw` found for type `Box<telemetry_t>` in the current scope src/lib.rs:41 Box::new(telemetry_t::new()).into_raw() ^~~~~~~~~~ src/lib.rs:41:34: 41:44 not | labels: A-diagnostics


ICE: `Result::unwrap()` on an `Err` value: Utf8Error | Compiler crashes while compiling https://github.com/CrystalGamma/rusttype/tree/bugrep0 using Cargo. Cargo version: cargo 0.6.0-nightly (18e496a 2015-10-17) rustc version: 1.3.0 ``` thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error { valid_up_to: 5


false positive non-exhaustive patterns: pattern guarded outside of match | ````rust pub fn func(a: Option<i32>, b: Option<i32>) { if a.is_some() || b.is_some() { match &(a,b) { /* 7 | match &(a,b) { | ^^^^^^ pattern `&(None, None)` not covered */ // (None, None) => {} // will never match due to if-condition (Some(_a), None) => {} (None, Some(_b)) => {}


false negative unused_mut | ````rust struct SomeStruct { path: std::path::PathBuf, } impl SomeStruct { fn path_exists(&mut self) -> bool { // false negative unused_mut // path.exists() does not need mutable reference: // pub fn exists(&self) -> bool { ... } self.path.exists() } } fn main() { let mut s = Som | labels: A-lints