{"id": "rust_152231", "text": "FileTimes::set_modified does not modify the time, but returns FileTimes | I tried this code: https://doc.rust-lang.org/std/fs/struct.FileTimes.html#method.set_modified ```rust | labels: E-easy, C-enhancement, A-filesystem, D-lack-of-suggestion", "label": "low", "label_id": 3} {"id": "rust_152470", "text": "[autodiff] compiler error when differentiating functions (like powi) | Follow up of [#wg-autodiff > Simplify autodiff handling of dependencies (rlib) @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/390790-wg-autodiff/topic/Simplify.20autodiff.20handling.20of.20dependencies.20.28rlib.29/near/573014613) for @ZuseZ4 and @sgasho | labels: T-compiler, C-bug, F-autodiff", "label": "low", "label_id": 3} {"id": "rust_150899", "text": "Better help text for incorrect `macro_rules!` usage | ### Code ```Rust macro_rules!(i_think_the_name_should_go_here) { () => {} } ``` ### Current output ```Shell error: macros that expand to items must be delimited with braces or followed by a semicolon --> src/lib.rs:1:13 | 1 | macro_rules!(i_think_the_name_shou | labels: A-diagnostics, A-macros, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_104463", "text": "Misleading comments over methods on `TyCtxtEnsure` in `rustc_middle::mir::interpret::queries` | > These comments (also the one below) are wrong now -- they talk about the return value of a function that doesn't return anything! I have no idea what is going on here so if someone could make a PR to update the comments, that would be much appreciated. :) _O | labels: A-docs, C-bug, A-contributor-roadblock, A-query-system", "label": "question", "label_id": 4} {"id": "rust_152510", "text": "Cleanup: go through `bootstrap.py` and make sure we specify explicit `open()` encodings | > Remark: we should go through `bootstrap.py` and make sure we specific explicit `open()` encodings, as far as I am aware there is a reasonable desire to want to make a future change in Python 3.* where `open()` defaults to UTF-8 encoding, which could break `o | labels: C-cleanup, T-bootstrap, A-Python", "label": "question", "label_id": 4} {"id": "rust_147465", "text": "Rust 1.90 causes Wasm crash by out of memory | After updating to Rust 1.90.0, Wasm becomes to be crashed by out of memory. The reproduce senquence is | labels: I-crash, regression-from-stable-to-nightly, O-wasm, C-bug, C-external-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_145866", "text": "RISC-V Extension Changes coming to LLVM 22 | In LLVM 22.x, we intend to simplify how the C and Zc* extensions are handled in the LLVM backend, in the change llvm/llvm-project#155035. This should more closely align with how these instructions are specified in the RISC-V specification. In clang, we are rel | labels: A-LLVM, T-compiler, O-riscv", "label": "medium", "label_id": 2} {"id": "rust_128203", "text": "Tracking Issue for `rwlock_downgrade` | foo.rs:4:1 | 4 | fn foo() -> | labels: A-lints, A-visibility, T-compiler, A-impl-trait, C-bug, L-private_interfaces", "label": "medium", "label_id": 2} {"id": "rust_151832", "text": "SIGSEGV during stage1 compilation of `proc_macro` for `i686-win7-windows-msvc` | Cross-compiling the stage1 from `x86_64-unknown-linux-gnu` to `i686-win7-windows-msvc` now seems to crash during the compilation of `proc_macro`: ``` Building stage1 library artifacts (stage1:x86_64-unknown-linux-gnu -> stage1:i686-win7-windows-msvc) Compiling | labels: I-crash, A-LLVM, T-compiler, C-bug, A-proc-macros, llvm-fixed-upstream", "label": "high", "label_id": 1} {"id": "rust_71850", "text": "Reuse LTO products for incremental builds when deps are unchanged | Incremental builds with LTO (`thin` or `fat`) always take the same amount of time (~10s on [my project](https://github.com/fenollp/reMarkable-tools/tree/730e3fc2c100a713abdeebeb434a9d86aa2a48cc/marauder)) when dependencies are unchanged. It seems to take as lo | labels: A-linkage, C-enhancement, I-compiletime, T-compiler", "label": "low", "label_id": 3} {"id": "rust_49569", "text": "Cryptic LTO-related error message when performing `include_bytes!` on large files | When trying to include a large (> 500MiB) binary in a program, the compiler crashes with an error message relating to LTO (Link time optimization?) I tried this code: ```rust fn main() { // the file below was generated with // $ dd if=/dev/urandom of=output.da | labels: A-codegen, A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_152347", "text": "regression: name resolution fails to find constant? | I'm not sure if this is our fault or something in the underlying library... ``` [INFO] [stdout] error[E0425]: cannot find value `TEST_MODULE_ID` in this scope [INFO] [stdout] --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/abstract-t | labels: A-resolve, T-compiler, regression-from-stable-to-beta, P-critical", "label": "critical_bug", "label_id": 0} {"id": "rust_151124", "text": "ICE: `DefId(..)): reachable Public > nominal Restricted(DefId(..)` | :2:5 | 2 | 0usize as *const U | ^^^^^^^^^^^^^^^^^^ ``` I | labels: C-enhancement, A-diagnostics, T-compiler, D-papercut, D-terse", "label": "low", "label_id": 3} {"id": "rust_151904", "text": "Rustdoc syntax highlighting of `ident !=` is displayed as a macro invocation `ident!` | # Code ```rs if layout != Layout::new::() { return Err(new_value); } ``` [Click here to view this live](https://docs.rs/tokio-util/0.7.18/src/tokio_util/sync/reusable_box.rs.html#106) # Expected Outcome The `layout !=` part is displayed in black. # Actual O | labels: T-rustdoc, C-bug, A-rustdoc-ui", "label": "low", "label_id": 3} {"id": "rust_147883", "text": "\"Size::sub: 0 - 8 would result in negative size\" ICE on sparc | **I tried this code**: ```rust // with --target=sparc64-unknown-linux-gnu #[repr(C)] pub struct Double | labels: P-medium, T-compiler, I-unsound, O-SPARC, C-bug, A-ABI", "label": "high", "label_id": 1} {"id": "rust_141679", "text": "error message for inherent `impl` on `type` that is external could be more explanatory | ### Code ```Rust use std::rc::Rc; pub struct Foo; pub type Function = Rc; impl Function { } ``` ### Current output ```Shell error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined --> src/lib.rs:6:1 | 6 | impl | labels: A-diagnostics, T-compiler, D-terse", "label": "medium", "label_id": 2} {"id": "rust_81059", "text": "Error message improvement: Manual reborrowing with `&mut *variable` | In this testcase, I wanted to reborrow `outer`, but accidentally wrote `&mut outer` instead of `&mut *outer`. However, the error's suggestion was ```try removing `&mut` here``` which wouldn't have worked. It would be better to have the suggestion ```try adding | labels: A-diagnostics, T-compiler, A-suggestion-diagnostics, D-papercut, D-newcomer-roadblock, D-invalid-suggestion", "label": "medium", "label_id": 2} {"id": "rust_82775", "text": "Tracking Issue for assert_matches | Rust 1.93.0 stable produces `wasm32-wasip2` components that are missing the `fd_close` import from `wasi_snapshot_preview1`. File descriptors are ne | labels: regression-from-stable-to-stable, C-bug, P-critical, T-libs, O-wasi, O-wasip2", "label": "critical_bug", "label_id": 0} {"id": "rust_124309", "text": "std::fs::create_dir_all will stack overflow with big paths | I tried this code: ```rust std::fs::create_dir_all(big_path); ``` I expected to see this happen: doesn | labels: C-bug, T-libs, A-io", "label": "medium", "label_id": 2} {"id": "rust_88051", "text": "Semantically equal `Ordering` matches generate different assembly | https://rust.godbolt.org/z/orxr8sffq I tried this code: ```rust use std::cmp::Ordering; pub fn a(x: i3 | labels: I-slow, C-bug", "label": "medium", "label_id": 2} {"id": "rust_152468", "text": "[ICE]: calling a `Fn` incorrectly in `core` ICEs when making the type error diagnostic | src/main.rs:10:5 | 10 | wut(); | ^^^^^ | = note: could not prove `for<'a> (dyn Tra | labels: A-type-system, I-ICE, A-trait-system, T-compiler, C-bug, T-types", "label": "high", "label_id": 1} {"id": "rust_151358", "text": "[ICE]: `!worker_thread.is_null()` | I tried this code: ```rust use std::future::{IntoFuture, Ready}; async fn test(t: T) -> u32 where T | labels: C-discussion, A-impossible-bounds", "label": "question", "label_id": 4} {"id": "rust_151273", "text": "ICE: `thir_body queried for type_const` (via cfg_attr) | I found this with the following code: ```rust #![allow(incomplete_features)] #![feature(min_generic_const_args)] pub trait Foo { #[cfg_attr(feature = \"some_feature\", type_const)] const N: usize; } impl Foo for u32 { #[cfg_attr(feature = \"some_feature\", type_co | labels: I-ICE, T-compiler, C-bug, requires-debug-assertions, F-min_generic_const_args", "label": "high", "label_id": 1} {"id": "rust_80317", "text": "Function pointer does not fulfill the required lifetime | Function pointers have no lifetime of their own, and essentially are `'static` ([Unsafe Code Guidelines Reference](https://rust-lang.github.io/unsafe-code-guidelines/layout/function-pointers.html)), so I would expect `fn(T) -> U: 'a` to hold for any lifetime ` | labels: A-lifetimes, C-bug, T-types", "label": "medium", "label_id": 2} {"id": "rust_138274", "text": "[bug] When I Use tauri-plugin-http and reqwest either, I got a panic | src/lib.rs:7:18 | 7 | for value in x..y {} | ^^^^ unsat | labels: A-diagnostics, T-compiler", "label": "question", "label_id": 4} {"id": "rust_82171", "text": "Unclear compiler error when `impl Trait` return value captures non-'static argument | (cc @estebank) I tried this code (the explicit `'static` lifetime is unnecessary but emphasizes the implicit `'static` requirement of `impl Trait`): ```rust fn foo(a: T) -> impl Iterator + 'static where T: std::fmt::Display { std::iter::once( | labels: A-diagnostics, A-lifetimes, T-compiler, A-impl-trait, C-bug, D-papercut", "label": "medium", "label_id": 2} {"id": "rust_152262", "text": "`-Clinker-plugin-lto` is required for inlining stdlib with LTO | ## Experiment setup Considering the following code: ```rust #![no_main] extern \"C\" { fn ftn() -> u32; } #[unsafe(export_name = \"_start\")] fn _start() -> f64 { let f77 = unsafe { ftn() } as f64; f64::cbrt(f77) } ``` The code is incorrect but quite good for demo | labels: A-linkage, T-compiler, C-bug, A-LTO", "label": "medium", "label_id": 2} {"id": "rust_152360", "text": "Issue | I tried this code: https://godbolt.org/z/Ts7ss7zj4 ```rust #[no_mangle] fn grow(v: &mut Vec) { | labels: C-optimization", "label": "medium", "label_id": 2} {"id": "rust_142577", "text": "Tracking Issue for reflection | This is a tracking issue for an un-RFC-ed language feature experiment The feature gate for the issue is `#![feature(reflection)]`. ### About tracking issues Tracking issues are used to record the overall progress of implementation. They are also used as hubs c | labels: T-lang, T-compiler, C-tracking-issue, S-tracking-unimplemented, B-experimental", "label": "question", "label_id": 4} {"id": "rust_149954", "text": "ICE: `None.unwrap()` in `tokenstream.rs` during `resolver_for_lowering_raw` | This bug was found with a fuzzer ([tree-splicer](https://github.com/langston-barrett/tree-splicer)). Reduced with [treereduce](https://github.com/langston-barrett/treereduce), then hand-reduced. [playground](https://play.rust-lang.org/?version=nightly&mode=deb | labels: I-ICE, A-parser, A-macros, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_152374", "text": "False postive: warning of unnecessary `unsafe` block | ### Code I tried this code: ```rust fn main() { let a = unsafe { core::arch::x86_64::__cpuid_count(0, 0) }; dbg!(a); } ``` I expected to see this happen: it compiles without warnings. Instead, this happened: it compiles with a warning of unnecessary `unsafe` b | labels: T-lang, T-libs-api, C-discussion, S-has-bisection", "label": "question", "label_id": 4} {"id": "rust_97804", "text": "Array Repeat operator should not use a loop for small sizes | This likely caused poor assembly for `Simd::splat` in some circumstances: https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/Very.20bad.20.60u16x8.3A.3Asplat.60.20codegen.20on.20x86_64 I opened a PR for a workaround: https://gith | labels: A-LLVM, I-slow, A-codegen, E-needs-test, T-compiler, A-SIMD", "label": "medium", "label_id": 2} {"id": "rust_55713", "text": "multiline cfg_attr in a doctest outputs a corrupted snippet | With following doctest, where the cfg attribute spans multiple lines, the final program is invalid: the wrapping `main` method doesn't take into account the dangling `stdsimd))]` line that closes the attribute. ```rust /// ```rust /// # #![cfg_attr(not(dox), f | labels: T-rustdoc, A-doctests", "label": "medium", "label_id": 2} {"id": "rust_114768", "text": "ICE: Failed to extract DefId: opt_local_def_id_to_hir_id | ### Code Can be reproduced by first building (in debug mode) `crates/yaboc-hir` of https://github.com/8051enthusiast/yabo at commit `442536c09df2fe898bfeda81a2788bf9dce9dc19` after a `cargo clean` and then building at commit `5d5d795041d55d3bcbe21c5052807711dd | labels: I-ICE, T-compiler, A-incr-comp, C-bug, S-has-mcve", "label": "high", "label_id": 1} {"id": "rust_152331", "text": "[ICE]: `arg len already exists` | /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/cogo-0.1.2/src/yield_now.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | let r = resour | labels: regression-from-stable-to-beta, I-prioritize", "label": "critical_bug", "label_id": 0} {"id": "rust_71025", "text": "Sub-optimal codegen: Unnecessarily dumping AVX registers to stack | I tried this code ([example 1](https://rust.godbolt.org/z/86FfSi)), in which we have a public function | labels: I-slow, C-enhancement, A-codegen, T-compiler, A-SIMD, C-optimization", "label": "low", "label_id": 3} {"id": "rust_152024", "text": "`unused_mut` false positive due to borrow-checking error | ### Code ```Rust struct Thing; impl Drop for Thing { fn drop(&mut self) {} } fn main() { let mut t; let mut b = None; loop { t = Thing; b.insert(&t); } } ``` ### Current output ```Shell warning: variable does not need to be mutable --> src/main.rs:7:9 | 7 | le | labels: A-lints, A-diagnostics, A-destructors, A-borrow-checker, T-compiler, L-unused_mut", "label": "medium", "label_id": 2} {"id": "rust_150352", "text": "Conflict markers with nonstandard lengths are not recognized as such | ### Code ```Rust <<<<<<<< ======== >>>>>>>> fn main() {} ``` ### Current output ```Shell error: expected identifier, found `<<` --> test.rs:1:1 | 1 | <<<<<<<< | ^^ expected identifier error: aborting due to 1 previous error ``` ### Desired output ```Shell erro | labels: A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_141313", "text": "GVN misunderstands aliasing, can create overlapping assignments (again) | This looks very similar to https://github.com/rust-lang/rust/issues/141038, but the compiler that found this has the patch that was linked to that issue. Reduced example from rustlantis, which is accepted by Miri without optimizations enabled: ```rust #![featu | labels: P-high, T-compiler, I-unsound, C-bug, A-mir-opt, I-miscompile", "label": "high", "label_id": 1} {"id": "rust_127215", "text": "`*x == *y` for trait objects produce move error, so it is not equivalent to `PartialEq::eq(&*x, &*y)` even though the reference says it is | [The following code produces a move error](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=45b377544d27adffcaa1f0b38cbe22e0): ```rust trait Animal { fn noise(&self) -> String; } impl PartialEq for dyn Animal { fn eq(&self, other: &Self | labels: A-diagnostics, A-borrow-checker, T-compiler, A-docs, C-bug, A-dyn-trait", "label": "low", "label_id": 3} {"id": "rust_150553", "text": "`#[expect(redundant_lifetimes)]` doesn't work when `#[derive(Debug)]` is present | Consider the following code: ```rust #![deny(redundant_lifetimes)] use std::fmt::Debug; #[derive(Debug)] pub struct RefWrapper<'a, T> where 'a: 'static, T: Debug, { pub t_ref: &'a T } ``` As expected, the compiler throws an error because the `'a` lifetime is r | labels: T-lang, C-bug, I-lang-radar", "label": "medium", "label_id": 2} {"id": "rust_135894", "text": "Tracking Issue for `atomic_try_update` | Feature gate: `#![feature(atomic_try_update)]` This is a tracking issue for an infallible version of `AtomicT::fetch_update` as well as a new name for the existing fallible version. When and if this gets stabilized, the existing `fetch_update` should be marked | labels: T-libs-api, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "question", "label_id": 4} {"id": "rust_138910", "text": "Linker-plugin-based LTO with -flto in clang not working | The original issue title was \"Implement cross-language ThinLTO,\" #49879 but when it was stabilized, the PR title became \"Stabilize linker-plugin based LTO (aka cross-language LTO),\" #58057 which seems to imply that fullLTO is available. The Rustc book states, | labels: A-LLVM, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_151966", "text": "LLDB testing should be disabled | Per @khyperia in https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/debuginfo.20tests.20broken.20locally/with/571307617 these tests don't run in CI. On a contributor's machine they can easily fail to pass, for reasons I am not going | labels: A-testsuite, A-debuginfo, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_136873", "text": "Tracking Issue for `cold_path` | Feature gate: `#![feature(cold_path)]` This is a tracking issue for `core::hint::{cold_path}`. Please also see the meta discussion at https://github.com/rust-lang/rust/issues/26179. `#![feature(likely_unlikely)]` was split to a new tracking issue: https://gith | labels: T-lang, T-libs-api, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_26179", "text": "Meta tracking issue for branch hints (RFC 1131) | Tracking and meta discussion for branch and path hinting, including: - `likely`/`unlikely` as accepted in rust-lang/rfcs#1131 (much has changed since this RFC) - `core::hint::{likely, unlikely}` https://github.com/rust-lang/rust/issues/151619 - `core::hint::co | labels: metabug, B-RFC-approved, T-lang, B-unstable, E-help-wanted, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_127031", "text": "`hir::Body`'s documentation incorrectly suggests it doesn't contain parmaeter info for closures | ### Location https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Body.html ### Summary Noticed this in rust-lang/rust-clippy#12981. The documentation says \"a function\" which I assume was meant to imply both a function/method call and closure w | labels: T-compiler, A-docs", "label": "low", "label_id": 3} {"id": "rust_151496", "text": "Local `rustc-docs` could make use of local pages for `std` types | Posting this for @blyxyas and big thanks for having spotted this issue real quick :) ### Location (URL) The same problem persists in many different pages, just to pick an example on my machine: `$RUSTUP_HOME/toolchains/nightly-aarch64-apple-darwin/share/doc/ru | labels: T-rustdoc, A-docs", "label": "low", "label_id": 3} {"id": "rust_152161", "text": "Inconsistent borrow-checking and temporary lifetime behavior with async closures | I've discovered some rather strange behavior involving borrow-checking and/or temporary lifetimes of async closures. Why does it behave this way? In the snippets below, `black_box` calls are done to be really clear that const promotion isn't occurring. The fol | labels: A-borrow-checker, C-bug, A-async-closures", "label": "medium", "label_id": 2} {"id": "rust_152123", "text": "mGCA: Support directly represented negated literals | Follow up of #150618 and #150699. We currently support directly represented literals as a `hir::ConstArgKind::Literal` but we don't support negated literals as such a representation: ```rust #![feature(adt_const_params, min_generic_const_args)] use std::marker | labels: E-easy, E-mentor, T-compiler, A-const-generics, F-adt_const_params, T-types", "label": "question", "label_id": 4} {"id": "rust_138226", "text": "ICE:expected const for `N/#0` (N/#0/0) but found Type(A) when instantiating args=[A] | /opt/rustwide/cargo-home/registry/src/index.crat | labels: A-attributes, P-high, T-lang, T-compiler, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_152124", "text": "mGCA: consolidate type const checks on `tcx.is_type_const` | Under `feature(min_generic_const_args)` const items have been split into two, \"const items\" and \"type const items\". Type const items are written with the `#[type_const]` attribute applied to the syntax of a normal const item. In some places in the compiler we | labels: E-easy, C-cleanup, E-mentor, T-compiler, A-const-generics, T-types", "label": "low", "label_id": 3} {"id": "rust_151967", "text": "Unexpected result from recursive macro rule | I tried this code: ```rust macro_rules! text_token { (\"{%\", $($token: literal,)*) => { println!(\"Found | labels: A-macros, C-bug, C-discussion, T-rust-analyzer", "label": "question", "label_id": 4} {"id": "rust_151950", "text": "unmangled symbols are not escaped in naked/global assembly | I tried this code: ```rust unsafe extern \"C\" { #[link_name = \"memset]; mov eax, 1; #\"] unsafe fn inject(); } #[unsafe(export_name = \"memset]; mov eax, 1; #\")] extern \"C\" fn inject_() {} #[unsafe(naked)] extern \"C\" fn print_0() -> usize { core::arch::naked_asm! | labels: A-codegen, C-bug", "label": "medium", "label_id": 2} {"id": "rust_108894", "text": "#[derive(Clone, Copy)] doesn't work | I tried this code: ```rust use std::marker::PhantomData; #[derive(Clone, Copy)] pub struct TypedAddress{ inner: u64, phantom: PhantomData, } pub trait Memory { fn write_value(&self, offset: TypedAddress, value: &T); fn return_value(&self, offset | labels: A-diagnostics, A-macros, T-compiler, A-suggestion-diagnostics, D-newcomer-roadblock", "label": "medium", "label_id": 2} {"id": "rust_145123", "text": "Performance regression with auto-vectorization from 1.87 onwards | ### Code I tried this code: ```rust pub fn unfilter_4(previous: &[u8], current: &mut [u8]) { let mut a_bpp = [0; 4]; let mut c_bpp = [0; 4]; for (chunk, b_bpp) in current.chunks_exact_mut(4).zip(previous.chunks_exact(4)) { let new_chunk = [ chunk[0].wrapping_a | labels: A-LLVM, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_152177", "text": "[ICE]: Compiler panic while compiling ppc64le rust code in linux tree | test.rs:12:11 | 12 | let a=A; | ^ unresolved name ``` Yet A is quite obviously imported. T | labels: P-medium, A-docs", "label": "low", "label_id": 3} {"id": "rust_26954", "text": "internal compiler error: unexpected panic | tried to compile the following code using `cargo build`: ``` rust pub fn anagrams_for<'a>(word: &'a str, variants: &'a [str]) -> &'a [str] { variants } ``` version: ``` ✗ rustc --version --verbose ruby-2.2.2 rustc 1.0.0-beta.3 (built 2015-04-30) binary: rustc commit-hash: unknown", "label": "high", "label_id": 1} {"id": "rust_26956", "text": "Excessive repeated errors when unsized slice is used in a for loop | This code: ``` rust fn main() { let vec = vec![1,4,35,13,42,1]; for x in vec[3..] { print!(\"{} \", x); } } ``` produces the following errors ``` main.rs:3:5: 5:6 error: the trait `core::marker::Sized` is not implemented for the type `[_]` [E0277] main.rs:3 for x in vec[3..] { main | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_26962", "text": "Additional 1.2. relnote items | - PR #26416 -- better error information for `std::io::Error`. cc @brson | labels: relnotes", "label": "medium", "label_id": 2} {"id": "rust_26964", "text": "Debug for CString is lossy | CString should escape its contents like a byte string, not trying to show it as utf-8. Right now it does the latter via `to_string_lossy()`", "label": "medium", "label_id": 2} {"id": "rust_26968", "text": "Explicit difference between .. and _ in patterns in docs | When reading the book, specifically the [Ignoring Variants](https://doc.rust-lang.org/book/patterns.html#ignoring-variants) in Patterns, I found it unclear that in a pattern `..` can match multiple fields. Thus couldn't figure out what made it differ from `_`, without playing wit", "label": "low", "label_id": 3} {"id": "rust_26969", "text": "LTO faulty build which is fixed by print!() | Found strange thing when i enable `lto` optimization: It always panics at this place https://github.com/DoumanAsh/collectionScripts/blob/lto_hyper/rust/vim_updater/src/main.rs#L43 ``` thread '
' panicked at 'called `Result::unwrap()` on an `Err` value: \"PoisonError { inner: ", "label": "medium", "label_id": 2} {"id": "rust_26970", "text": "Misleading error message on use of FnOnce<(T, U), Output=V> | [This stack overflow question](http://stackoverflow.com/questions/31353960/how-to-use-parentheses-for-generics/31354984?noredirect=1#comment50696461_31354984) shows that if one tries to declare a `FnOnce<(T, U), Output=V>` (which should be a `FnOnce(T, U) -> V`), the error messag | labels: A-diagnostics, A-closures", "label": "question", "label_id": 4} {"id": "rust_26971", "text": "Cannot build rust on OS X 10.11 public beta | ``` ==> ./configure --prefix=/Users/andrewrynhard/develop/homebrew/Cellar/rust/HEAD --disable-rpath --enable-clang --release-channel=nightly configure: configure: note, user-provided CC looks like clang; CC=clang. configure: configure: CFG_USING_CLANG := 1 configure: error: bad C", "label": "medium", "label_id": 2} {"id": "rust_26975", "text": "for loop issue | hi, the following code just just terminates without any error...ideas? if this code is not allowed the compiler needs to create an compile error? ``` fn main() { for i in (10..0) { println!(\"{}\", i); } } ``` playground: http://is.gd/yLCmj2 i know you could use: for i in (0..10).r", "label": "medium", "label_id": 2} {"id": "rust_26989", "text": "only string and byte strings supported in compare_values | When I try to compile my code, the compiler fails with \"only string and byte strings supported in compare_values\";. My code: ``` rust struct Foo { x: Option, y: Option } fn main() { let mut test = Foo {x: Option::None, y: Option::Some(32)}; match test { Foo {x: Some(12) | labels: I-ICE", "label": "question", "label_id": 4} {"id": "rust_26991", "text": "impl is not introduced in the book | There's only a few references to `impl<` in TRPL: 1. src/doc/trpl/deref-coercions.md 2. src/doc/trpl/lifetimes.md 3. src/doc/trpl/unsized-types.md None of these really mention that you use `impl` to declare a typename that will participate in either the trait or item involved ", "label": "medium", "label_id": 2} {"id": "rust_26994", "text": "quasi-quoting a block expression doesn't work | `quote_expr!(self.cx, { $result_name = Some($expr); break $loop_label; })` failed with `error: expected one of`.`,`;`,`}`, or an operator, found`'__hoare_2``(`__hoare_2`is the expected value of`$loop_label`). This failed in expansion so I couldn't get an expanded AST to find out | labels: A-syntaxext, P-low, C-bug", "label": "low", "label_id": 3} {"id": "rust_26995", "text": "404 for rustdoc [src] links for files with absolute paths | When the path to a source file as known to the compiler is absolute (which can happen with `#[path = \"/…\"] mod foo;` or `include!`), rustdoc fails to include the source of these files in its output. For example, the [src] link on http://doc.servo.org/script/dom/bindings/codegen/B | labels: T-rustdoc", "label": "question", "label_id": 4} {"id": "rust_26996", "text": "Wrong code with assignment in match body | ``` rust fn main() { let mut c = (1, \"\".to_owned()); match c { c2 => { c.0 = 2; assert_eq!(c2.0, 1); } } } ``` ``` thread '
' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', :4 playpen: application terminated with error code 101 ``` | labels: A-codegen", "label": "medium", "label_id": 2} {"id": "rust_26997", "text": "ICE: 'assertion failed: index < LLVMCountParams(llfn)', ../src/librustc_llvm/lib.rs:2250 | The compiler panics when trying to compile this code: ``` pub struct Foo { x: isize, y: isize } impl Foo { pub extern fn foo_new() -> Foo { Foo { x: 21, y: 33 } } } ``` This is with ``` rustc 1.3.0-nightly (67256dff6 2015-07-09) binary: rustc commit-hash: 67256dff6dd7526f0be9da50 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_26998", "text": "Pattern guards should run at most once | ``` rust use std::cell::Cell; fn main() { let i : Cell = Cell::new(0); match 1 { 1 | _ if { i.set(i.get() + 1); false } => {} _ => {} } assert_eq!(i.get(), 1); } ``` ``` thread '
' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', :9 playp", "label": "medium", "label_id": 2} {"id": "rust_27004", "text": "ICE when using macro as for loop parameter | ``` macro_rules! foo { () => () } pub fn main () { for foo!() in (1..) { } } ``` error: ``` 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/mas | labels: I-ICE, A-macros", "label": "high", "label_id": 1} {"id": "rust_27005", "text": "Missing \"unreachable pattern\" error with range | ``` rust fn main() { match 'a' { 'a' => {} 'b' => {} 'a'...'b' => {} _ => {} } } ``` Currently compiles, but the `'a'...'b'` pattern is clearly unreachable. | labels: A-type-system, P-low", "label": "low", "label_id": 3} {"id": "rust_27008", "text": "wrong error when using a unit struct as length of a repeat expression | ``` rust struct A { i: i32}; let a = [0; A{i: 42}]; ``` yields the expected ``` error: expected positive integer for repeat count, found struct [E0306] ``` while ``` rust struct B; let b = [0; B]; ``` thinks that `B` is a variable ``` error: expected constant integer for repeat c | labels: E-easy, A-diagnostics", "label": "low", "label_id": 3} {"id": "rust_27009", "text": "Ownership error masks missing implementation of trait | I would expect the main function to not compile because clone() has not been implemented for struct Test. However this error is masked by: `src/main.rs:26:2: 26:7 error: cannot borrow`tests`as mutable because it is also borrowed as immutable` The error here is the missing impleme", "label": "medium", "label_id": 2} {"id": "rust_27010", "text": "Buildbot Request: Add one `--enable-debug --enable-optimize` bot that at least bootstraps (no tests) | Spawned off of #26484 Just as it is important to developers that we try to avoid injecting test regressions (and thus we have bors check that the regression test suite passes before every commit to master), it is also important to developers that the debug-enabled build of `rustc", "label": "high", "label_id": 1} {"id": "rust_27014", "text": "Rustdoc error output is unnecessarily verbose when encountering unknown file | What `rustc` displays when encountering an unknown file: ``` /tmp $ rustc filename-that-does-not-correspond-to-a-file error: couldn't read \"filename-that-does-not-correspond-to-a-file\": No such file or directory (os error 2) ``` ...and what `rustdoc` displays: ``` /tmp $ rustdoc | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27021", "text": "Wrong code with assignment in match body, part 2 | ``` rust fn main() { let mut c = (1, (1, \"\".to_owned())); match c { c2 => { (c.1).0 = 2; assert_eq!((c2.1).0, 1); } } } ``` ``` thread '
' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', :4 ``` CC @dotdash .", "label": "medium", "label_id": 2} {"id": "rust_27022", "text": "lang-item-public.rs run-pass test fails | When configured with `./configure --enable-rpath --disable-clang --disable-libcpp --enable-llvm-assertions --release-channel=dev --enable-debug --enable-optimize` on linux, running tests will fail with ``` ---- [run-pass] run-pass/lang-item-public.rs stdout ---- error: compilatio | labels: A-testsuite", "label": "medium", "label_id": 2} {"id": "rust_27023", "text": "Wrong size passed to free in issue-26709.rs run-pass test (yielding jemalloc assert fail) | After `./configure --enable-rpath --disable-clang --disable-libcpp --enable-llvm-assertions --release-channel=dev --enable-debug --enable-optimize` on linux, running tests will fail with: ``` ---- [run-pass] run-pass/issue-26709.rs stdout ---- error: test run failed! status: sign | labels: I-crash, A-testsuite, T-compiler", "label": "high", "label_id": 1} {"id": "rust_27027", "text": "catch_panic claims that it returns Ok(()) | This appears to be false from reading the source; it looks like it actually returns the value of the closure if no panic occurs.", "label": "medium", "label_id": 2} {"id": "rust_27031", "text": "Rust does not allow narrowing the mutable references | Currently rust does allow to narrow the immutable references as long as the don't appear in contravariant position: ``` rust // This compiles struct Foo1<'a> { a: &'a Fn(&'static str) -> u32 } fn foo1<'a : 'b, 'b>(foo: Foo1<'a>) -> Foo1<'b> { foo } // This, correctly, does not co | labels: A-type-system, A-lifetimes", "label": "medium", "label_id": 2} {"id": "rust_27033", "text": "Missing shadowing diagnostic with \"@\" in pattern-match | ``` rust fn main() { match Some(1) { None @ _ => { } }; //let None = 1; } ``` ``` :2:19: 2:27 warning: unused variable: `None`, #[warn(unused_variables)] on by default :2 match Some(1) { None @ _ => { } }; ^~~~~~~~ ``` This is accepted, but probably shouldn't be. (A n | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_27035", "text": "TRPL markup [^moving] rendered as superscript | The source markup for https://doc.rust-lang.org/book/the-stack-and-the-heap.html#the-heap contains: ``` md In this case, however, it doesn’t.[^moving] When the function is over, … [^moving]: We can make the memory live longer by transferring … ``` It’s rendered as: ``` html In th | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27037", "text": "Calling a static trait method on a type doesn't mark it as used. | ``` rust enum Empty {} struct Unit; trait Run { fn run() -> u8; } impl Run for Empty { fn run() -> u8 { 0 } } impl Run for Unit { fn run() -> u8 { 1 } } fn main() { println!(\"{} {}\", Empty::run(), Unit::run()); } ``` ``` $ rustc -V rustc 1.3.0-nightly (6d71ce536 2015-07-06) $ rus", "label": "medium", "label_id": 2} {"id": "rust_27042", "text": "Bad span for labeled loops | Rustc's parser does not include a loop's label in its span. So the span associated to the expression ``` rust 'somelabel: loop { whatev(); } ``` will contain only ``` rust loop { whatev(); } ``` cc @nrc | labels: E-easy, A-parser", "label": "low", "label_id": 3} {"id": "rust_27043", "text": "Linkage regression in servo with 1.2 | See https://github.com/servo/servo/pull/6591#issuecomment-121256880 After some tweaks to how rustc drives the linker Servo no longer links. We should decide whether this is intentional and acceptable. | labels: regression-from-stable-to-nightly, T-compiler, relnotes", "label": "critical_bug", "label_id": 0} {"id": "rust_27048", "text": "Can't define a trait with an associated type and function of the same name | This doesn't work: ``` rust trait Foo { type Bar; fn Bar(); } ``` The error you get: ``` trait_type_method_same_name.rs:3:5: 3:14 error: duplicate definition of type or module `Bar` trait_type_method_same_name.rs:3 fn Bar(); ^~~~~~~~~ trait_type_method_same_name.rs:2:5: 2:14 note | labels: A-trait-system, A-associated-items", "label": "medium", "label_id": 2} {"id": "rust_27049", "text": "Rust Book \"Mutability\" section is unclear | The explanations in src/doc/trpl/mutability.md are unclear, especially compared to the rest of TRPL, which is generally pretty great. > When a binding is mutable, it means you’re allowed to change what the binding points to. So in the above example, it’s not so much that the valu", "label": "medium", "label_id": 2} {"id": "rust_27051", "text": "Documentation of collections::string::String and std::string::String is off. | I noted that the documentation for `collections::string::String` and `std::string::String` is a little off. In _the_ IRC channel was said that this could be a serialization bug, so I'm reporting this here now. The differences are that in `collections::string::String` there are li | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27053", "text": "running \"make -j8 rustc-stage1 && make check-stage1\" yields lldb error in debuginfo tests | When I run make -j8 rustc-stage1 && make check-stage1, I'm having problems during the check phase, as the lldb-debuginfo tests fail. I'm running OSX Mavericks (10.9.5), python 2.7.10 (also tried 2.7.5). The errors all look approximately like the following: ---- [debuginfo-lldb] d | labels: O-macos", "label": "medium", "label_id": 2} {"id": "rust_27054", "text": "Primitive binops are translated wrong when the LHS is mutated | ## STR ``` Rust fn main() { let x = Box::new(0); println!(\"{}\", *x + { drop(x); let _ = Box::new(main); 0 }); } ``` ## Expected Results If this code compiles, it should print `0`. ## Actual Results Garbage is printed (the address of `main`, in fact). | labels: E-needs-test, P-medium, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27057", "text": "Have rustc report --disable-elf-tls option | Per https://bugzilla.mozilla.org/show_bug.cgi?id=1181441#c4 we have the `--disable-elf-tls` option to support MacOS X 10.6. This requires a custom build, and therefore users need a way to detect whether a given build has that customization. For Firefox I wrote a configure feature | labels: A-frontend", "label": "question", "label_id": 4} {"id": "rust_27058", "text": "Some example code not showing in rustdoc | Following #rust conversation with kimundi (just now from about 11:18pm +01:00), I found a [useful example](https://doc.rust-lang.org/stable/src/core/result.rs.html#883-890) in the source, ``` rust /// Takes each element in the `Iterator`: if it is an `Err`, no further /// element", "label": "medium", "label_id": 2} {"id": "rust_27059", "text": "Test makes reference to file that doesn't exist | https://github.com/rust-lang/rust/blob/e4e93196e16030ebf7a20c473849534235d676f8/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs#L12-L13 I don't think gdb-pretty-struct-and-enums.rs is still around", "label": "medium", "label_id": 2} {"id": "rust_27060", "text": "repr(packed) allows invalid unaligned loads | This is now a tracking issue for [RFC 1240](https://github.com/rust-lang/rfcs/blob/master/text/1240-repr-packed-unsafe-ref.md), \"Taking a reference into a struct marked `repr(packed)` should become `unsafe`\", but originally it was a bug report that led to the development of that | labels: I-crash, P-medium, E-mentor, B-RFC-approved, T-lang, T-compiler", "label": "question", "label_id": 4} {"id": "rust_27062", "text": "Add IntoRaw{Fd, Socket, Handle} traits | Tracking issue for https://github.com/rust-lang/rfcs/pull/1174 | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_27063", "text": "Arc.clone() Method Chaining -> \"borrowed value does not live long enough\" | I have the following Code: ``` rust use std::sync::{Arc, RwLock}; fn main() { let mut i = 5; let arc = Arc::new(RwLock::new(i)); println!(\"{}\", i); { let copy = arc.clone(); let local_i = *copy.read().unwrap(); println!(\"{}\", local_i); } { let local_i = *arc.clone().read().unwrap", "label": "medium", "label_id": 2} {"id": "rust_27072", "text": "Compiler panicked | I got the compiler to panic. Here is the **backtrace**: ``` $ RUST_BACKTRACE=1 cargo build Compiling mdbook v0.0.1 (file:///home/mathieu/Programming/Rust/mdbook) error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we wou", "label": "high", "label_id": 1} {"id": "rust_27075", "text": "matching on std::net::AddrParseError triggers \"use of unmarked library feature\" | ``` rust match Ipv4Addr::from_str(blah) { Ok(ip) => Ok(ip), Err(AddrParseError(_)) => Err(\"cannot parse address\") } ``` ``` src/main.rs:84:32: 84:33 error: use of unmarked library feature src/main.rs:84 Err(AddrParseError(_)) => Err(\"cannot parse address\") ^ src/main.rs:84:32: 84", "label": "medium", "label_id": 2} {"id": "rust_27077", "text": "Incorrect codegen with shadowed constants in a match arm | From @eefriedman's comment in #27033: ``` rust fn main() { const C: u8 = 3; match 1 { C @ 2 => { println!(\"{}\", C); } _ => {} }; } ``` ``` :4:9: 4:14 warning: unused variable: `C`, #[warn(unused_variables)] on by default :4 C @ 2 => { println!(\"{}\", C); } ^~~~~ Switch | labels: A-codegen, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_27078", "text": "internal compiler error: no def for path when using associated consts | ``` Rust #![feature(associated_consts)] trait Foo { const BAR: i32; fn foo(self) -> &'static i32 { &::BAR }} fn main() {} ``` ``` :3:61: 3:72 error: internal compiler error: no def for path 17 :3 trait Foo { const BAR: i32; fn foo(self) -> &'static i32 { & | labels: I-ICE, E-needs-test, A-associated-items, C-bug, A-const-eval", "label": "high", "label_id": 1} {"id": "rust_27083", "text": "Mismatched signature in trait implementation with lifetimes not caught | I _think_ this shouldn't compile, but it does (in rustc 1.3.0-dev (fddfd089b 2015-07-10)): ``` rust struct Foo; trait Bar { fn get_style<'a>(&'a self, r: &'a Foo) -> &'a Foo; } impl Bar for Foo { fn get_style<'a>(&self, r: &'a Foo) -> &'a Foo { r } } fn main() {} ``` | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_27086", "text": "Semantics of closures and structs do not exactly correspond | There are a few places where the semantics we enforce for closures could not be faithfully simulated by end-users. These omissions are accidental, but programs do rely on them, and removing them breaks reasonable looking programs. I identified these as part of a patch that expose | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_27090", "text": "B+ Tree in BTreeMap | Based on my knowledge regarding BTrees (I know how they are built, how they work and I also know what a B+ tree is), which I know is by far not the best, I think you might really want to use a B+ Tree](https://en.wikipedia.org/wiki/B%2B_tree) if you do not already. That would mak", "label": "medium", "label_id": 2} {"id": "rust_27092", "text": "Compiler crash on macro_rules | This macro code and invocation: ``` rust macro_rules! test_cases { ( $(#[$case_name:ident($($test_case:expr),+)])+ $test_name:ident ($($param_name:ident),+) $(use $paths::path;)* $test_code:block ) => (); } test_cases!( #[a(1)] t (c) { } ); ``` causes the following backtrace: ``` | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27097", "text": "dead link in documentation | There is a dead link on [doc.rust-lang.org/[…]/trait.Copy.html](http://doc.rust-lang.org/std/marker/trait.Copy.html). If you scroll down to the implementations and click on `Fp` you run into a 404.", "label": "medium", "label_id": 2} {"id": "rust_27104", "text": "Have rustdoc document private items, except `use` and `extern crate` | Rustdoc defaults to only documented things that are public, i.e. things that the user of a library would care about. This is a good default, but rustdoc can also be useful to people working on large crates by documenting these crates themselves. In that case, it’s preferable to a | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_27105", "text": "Nested `CoerceUnsized` is not infered properly | The following piece of code does not compile: ``` Rust pub struct Callbacks { callbacks: Vec>>, } impl Callbacks { pub fn register(&mut self, callback: F) { self.callbacks.push(Rc::new(RefCell::new(callback))); } } ``` ([Playpen](http | labels: A-type-system", "label": "question", "label_id": 4} {"id": "rust_27106", "text": "Bad interaction of smart pointers, auto-deref and closures | The following code does not compile: ``` Rust use std::rc::Rc; use std::cell::RefCell; pub struct Callbacks { callbacks: Vec>>, } impl Callbacks { pub fn call(&mut self, val: i32) { for callback in self.callbacks.iter() { let mut closure = callback.borrow_m | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_27107", "text": "Warn if result of a comparison is not used | Currently Rust will not warn if the result of an \"==\" comparison is not used like \" is_file_set == true; \". It would be very useful to have that warning. | labels: C-enhancement, A-lints", "label": "low", "label_id": 3} {"id": "rust_27109", "text": "std::borrow::Borrow should have big fat warnings all over it | There are hidden assumptions around `Borrow` that don’t appear to be included in _any_ of the documentation that I can find. Most notably, `HashMap`’s use of `Borrow` requires that `K` and `Q` (`where K: Borrow`) hash the same; if they don’t, your `HashMap` will be mysteriousl", "label": "medium", "label_id": 2} {"id": "rust_27112", "text": "better diagnostic for `try!` in main | new Rust users try `try!` in `main()` quite a bit. Adding a better diagnostic than `()` isn't `Result` would be nice. | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27113", "text": "Fulfill additional higher-kinded \"outlives\" predicates | Types fail to fulfill higher-kinded \"outlives\" predicates when the higher-kinded region is present on the left-hand side of the predicate. For example: ``` rust fn foo() where for<'a> &'a T: 'a {} fn main() { foo::(); //~^ ERROR the requirement `for<'a> &'a i32: 'a` is no | labels: A-type-system, A-trait-system, E-needs-test, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27116", "text": "make all semicolons optional, there is no need in them | Modern languages like Scala and Groovy do not enforce users to write semicolons. I think it is a right decision, because in fact semicolons are nothing more than just a redundant typing. I've been a scala developer for many years and I only needed semicolons when putting several ", "label": "medium", "label_id": 2} {"id": "rust_27119", "text": "rustc panicks when dealing with reference to functions in enum variants | Summary of the bug is in the title I tried with this code : ``` rust enum Event { ENTRY, EXIT, } struct Data; struct State<'a> { f: Fn(&mut Data, &Event) -> &'a Signal<'a>, } enum Signal<'a> { UNHANDLED, HANDLED, TRAN(Fn(&mut Data, &Event) -> &'a Signal<'a>), } struct FSM<'a> { c | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27123", "text": "rustdoc: items are shown as if defined in crate when reexported cross-module and cross-crate | Consider ``` rust extern crate innercrate; //defines only one public item `from_inner_crate` pub use inner::{inner_fn, from_inner_crate}; /// Top level documentation pub fn top_level(){} pub mod inner { pub use innercrate::from_inner_crate; /// Defined inside inner module pub fn | labels: T-rustdoc, P-low, A-docs", "label": "low", "label_id": 3} {"id": "rust_27124", "text": "Rust building is broken for BSD system | Starting with the latest update of LLVM, several BSD system don't be able to build rust anymore. At least: - freebsd: http://buildbot.rust-lang.org/builders/auto-freebsd10_64-1/builds/2/steps/compile/logs/stdio - bitrig: http://buildbot.rust-lang.org/builders/auto-bitrig-64-opt/b", "label": "medium", "label_id": 2} {"id": "rust_27125", "text": "random ICE in util::interner::StrInterner::get / print::pprust::token_to_string | A followup issue from https://github.com/hackndev/zinc/issues/332. rustc crashes inside plugin invocation as reported by @enginespot. I myself have tried the exact same OS version and rustc build and it all works fine for me, while being reproducible for @enginespot. This doesn't | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27126", "text": "No SyntaxExtension variant can modify foreign items | `SyntaxExtension::MultiModifier` only visits true items, ImplItems, and TraitItems, not `ForeignItem`s. This makes it impossible to write syntax extensions which operate directly on foreign items (e.g. functions declared inside an `extern` block). I started work on https://github | labels: A-syntaxext, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_27128", "text": "Compiler bug with rustc 1.3.0-nightly (e4e93196e 2015-07-14) | Got the following with `rustc 1.3.0-nightly (e4e93196e 2015-07-14)`: ``` thread 'rustc' panicked at 'index out of bounds: the len is 92 but the index is 530', ../src/libcollections/vec.rs:1376 stack backtrace: 1: 0x108cda785 - sys::backtrace::write::ha27d712b848aedc4Eos 2: 0x108c | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27130", "text": "Manipulating slice through &mut parameter not optimized well | When passing a `&mut &[u8]` to a function that trims elements from the start/end of the slice, the code contains pointless length checks and stack traffic. Writing the function slightly differently, or inlining it, does produce the code I'd expect. This is a minimal example ([pla | labels: I-slow, C-enhancement, A-codegen, E-needs-test, P-low, T-compiler", "label": "low", "label_id": 3} {"id": "rust_27141", "text": "negate_unsigned feature gate warning should be changed to feature gate. | negate_unsigned feature gate (librustc_lint/builtin.rs) currently emits a warning instead of actual feature_gate due to backwards [compatibility concerns](https://github.com/rust-lang/rust/pull/27026#issuecomment-122787339). After some time passes this warning should be converted", "label": "medium", "label_id": 2} {"id": "rust_27142", "text": "rustc cannot statically link to C library | When trying to link to a static C library called `md` ``` rustc src/lib.rs [...] -L native=/path/to/md -l static=md ``` it fails: ``` error: linking with `cc` failed: exit code: 1 [...] note: /usr/bin/ld: /path/to/md/libmd.a(acosh.o): relocation R_X86_64_32 against `.data' can no", "label": "medium", "label_id": 2} {"id": "rust_27149", "text": "Internal crates are documented for stable but not nightly | https://doc.rust-lang.org/stable/std/ documents many crates including rustc and syntax, whereas https://doc.rust-lang.org/nightly/std/ only has std and its dependencies. This seems backwards, and opposite of what the commit message for e64b677ca66d742e7c06738bacf3a160cba827a7 / # | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27152", "text": "std::process::Command.status() hangs if subprocess output is >64K characters | std::process::Command hangs in status(), even if output() was called first, if the subprocess prints more than 64K characters to stdout. This Rust program hangs between the two println!() statements, but passes if you change 65536 to 65535: ``` use std::process::Command; use std:", "label": "medium", "label_id": 2} {"id": "rust_27161", "text": "Extend missing_doc lint to consts and statics again. | Reverting [here](https://github.com/rust-lang/rust/pull/27160) until [this RFC](https://github.com/rust-lang/rfcs/pull/1193) is implemented. | labels: E-easy", "label": "low", "label_id": 3} {"id": "rust_27162", "text": "Bad span for range | The span for the range in ``` rust for _ in 0..10 { ... } ``` is `0..10 {`, whereas it should be just `0..10`. | labels: A-parser, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_27165", "text": "Issue with suggestion for Clone | I wrote an implementation for Clone but forgot to import it. Here's the error I got initially: ``` src/server/service.rs:123:67: 123:74 error: no method named `clone` found for type `server::service::OpenTime` in the current scope src/server/service.rs:123 s.open_times.insert(key | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27178", "text": "jemalloc(?) bug while iterating std::io::Lines | I am using the following code to read from a file and print it line by line: ``` rust use machine_state::OpCode; use std::io::prelude::*; use std::io::BufReader; use std::fs::File; use std::path::Path; pub fn parse(path_string: &String) { let path = Path::new(path_string); let mu", "label": "low", "label_id": 3} {"id": "rust_27179", "text": "Multiple specialisations possible but no way to select one. | In the following example ([playground](http://is.gd/nNw6gv)) I cannot specify which `new` to use. I was surprised that I could write the second implementation in the first place as [RFC#1210](https://github.com/rust-lang/rfcs/pull/1210) is not accepted yet. So there are no rules ", "label": "medium", "label_id": 2} {"id": "rust_27181", "text": "compiler unexpectedly panicked. \"this is a bug.\" | Two sets of this error: ``` 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/master/CONTRIBUTING.md#bug-reports note: run with `RUST_BACKTRACE=1 | labels: A-debuginfo, I-ICE", "label": "high", "label_id": 1} {"id": "rust_27187", "text": "Improve code of conduct visibility | Rust is often credited with a great community, a code of conduct would add greatly to this. Sample: http://todogroup.org/opencodeofconduct/", "label": "medium", "label_id": 2} {"id": "rust_27189", "text": "Add `rustc --fatal` which stops at the first build error | (Should this be an RFC?) ## Motivation When refactoring, one may have dozens or hundreds of build errors which need to be fixed one by one. Sometimes, a build error is only a consequence of an earlier error rather than something that need to be fixed itself: ``` rust let foo = ba | labels: A-frontend, A-diagnostics, T-compiler, C-feature-request, D-verbose", "label": "low", "label_id": 3} {"id": "rust_27190", "text": "internal compiler error: unexpected panic | ``` rustc --version rustc 1.3.0-dev (136c623a6 2015-07-20) 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/master/CONTRIBUTING.md#bug-reports t | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27195", "text": "Rust and C use different in-struct f64 alignment on x86 linux | In particular the x86 linux C ABI has f64 aligned to 8 bytes normally, but only 4 bytes while in a struct. Rust gives f64 an unconditional 8 byte alignment. In addition, the Rust struct is not padded for its size to be a multiple of its alignment, meaning that the struct's alignm | labels: O-linux, O-x86_32", "label": "medium", "label_id": 2} {"id": "rust_27196", "text": "ICE: coherence failed to report ambiguity: cannot locate the impl of the trait | ICE resulting from insufficiently specified/unknown types and nested matching. I tried this code: ``` rust let (printSend, printRec) = channel(); let printer = thread::spawn(move || { loop { match printRec.recv() { Ok(file) => { match file { Some(f) => println!(\"{}\", f), None => | labels: A-type-system, I-ICE, A-trait-system, T-compiler", "label": "high", "label_id": 1} {"id": "rust_27198", "text": "Please provide unprivileged install for RUST | For users on Windows OS without the full admin/privileged rights it is impossible to install RUST therefore please provide a possibility to install RUST by other means than MSI (installer). | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_27200", "text": "Audit dependencies of libcore | Current output of `objdump -t libcore-7e44814b.rlib | grep UND` on x86-64 Linux: ``` 0000000000000000 *UND* 0000000000000000 __morestack 0000000000000000 *UND* 0000000000000000 __powidf2 0000000000000000 *UND* 0000000000000000 __powisf2 0000000000000000 *UND* 0000000000000000 cei", "label": "medium", "label_id": 2} {"id": "rust_27211", "text": "Inconsistent escaping of special characters between &str and &OsStr with Debug | Formatting a string containing special characters with `Debug` usually prints them escaped i.e.`\"\\r\\n\\t\"`. ``` fn main() { use std::ffi::OsStr; let str = \"Hello\\r\\n\\tThere\"; let os_str: &OsStr = str.as_ref(); println!(\"{:?}\", str); println!(\"{:?}\", os_str); } ``` This snippet run | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_27214", "text": "ptr-ptr cast does not work well with lifetimes (lifetime widening) | ## STR ``` Rust fn foo<'a>(v: *const &'a ()) { let v: *const &'static () = v as *const &'static (); } fn main() {} ``` ## Expected result cast will be successful ## Actual Result ``` :2:33: 2:34 error: mismatched types: expected `*const &'static ()`, found `*const &'a ()` ( | labels: A-type-system, A-lifetimes, T-compiler, C-bug, A-coercions, A-raw-pointers", "label": "medium", "label_id": 2} {"id": "rust_27218", "text": "'infinite' loop of E0119 error messages | While convoluting some code to try to find error messages, I came across a loop in the errors. The code: impl Drop for T { fn drop(&mut self) {} } The errors: ``` 120.rs:17:1: 19:2 error: the Drop trait may only be implemented on structures [E0120] 120.rs:17 impl ( S($val) ); //( $val:expr ) => ( S($val) ); } fn main() { let s: S = mac!(4); println!(\"{}\", s.0); } ``` ``` :4:24: 4:28 error: unexpected token: `4` :4 ( $val:tt ) => ( S($val) ); ^~~~ ``` | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_27237", "text": "Add HashMap::get_pair? | `HashMap` has this method: ``` rust pub fn get(&self, k: &Q) -> Option<&V> where K: Borrow, Q: Hash + Eq { self.search(k).map(|bucket| bucket.into_refs().1) } ``` I’d like to add this one, where the only difference is removing `.1`: ``` rust pub fn get_pair(T); impl Drop for NoisyDrop { fn drop(&mut self) { println!(\"dropping {:?}\", self.0) } } struct Bar([*const NoisyDrop; 2]); fn fine() { let (u,b); u = vec![43]; b = Bar([&NoisyDrop(&u), &No | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_27241", "text": "dropck is unsound with closure upvars | This should be fixed by @nikomatsakis's new patch even if the code isn't changed, but I thought it would be nice to track too. ``` Rust use std::fmt; struct NoisyDrop(T); impl Drop for NoisyDrop { fn drop(&mut self) { let _ = vec![\"0wned\"]; printl", "label": "medium", "label_id": 2} {"id": "rust_27243", "text": "Make HashMap use a per-process or per-thread seed instead of a per-instance seed | Currently every call to HashMap::new makes a new RandomState that makes two new calls to the thread_rng to create its seed. This is, to my knowledge cryptographic overkill, as there is no clear distinction between a single HashMap with a seed and many HashMaps with the same seed, | labels: E-easy, E-mentor", "label": "critical_bug", "label_id": 0} {"id": "rust_27245", "text": "Allow macros in type positions | Tracking issue for rust-lang/rfcs#873 | labels: E-easy, E-mentor, B-RFC-approved, T-lang, B-unstable, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_27247", "text": "Same compiler error two times | Hi everybody, while playing around with rust for the first time (which is great fun!), I noticed something odd. Compiling this: https://play.rust-lang.org/?gist=fb5a1d527f2681d38858&version=stable gives me the same error two times on stable, beta and nightly. Edit: the given erro | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27248", "text": "'missing lifetime specifier' regression in protobuf-1.0.1 | As [reported by crater](https://internals.rust-lang.org/t/new-crater-reports-1-1-stable-vs-beta-2015-07-10-and-nightly-2015-07-10/2358), Rust 1.3 nightlies appear to have [introduced a regression in lifetime elision](https://tools.taskcluster.net/task-inspector/#cuF_XQCSRQafsszsN | labels: regression-from-stable-to-nightly, I-needs-decision, P-high, T-lang", "label": "critical_bug", "label_id": 0} {"id": "rust_27249", "text": "ICE when using associated constants | The following code results in a compiler panic: ``` #![feature(associated_consts)] struct Foo; impl Foo { pub const FOO: u32 = 3; } fn main() { Foo::FOO; } ``` Backtrace: ``` $ RUST_BACKTRACE=1 rustc a.rs a.rs:11:5: 11:14 warning: path statement with no effect, #[warn(path_statem | labels: I-ICE, A-associated-items", "label": "question", "label_id": 4} {"id": "rust_27254", "text": "Setting --libdir breaks rustc build | Fedora x86_64 builds install libraries to /usr/lib64 so that 32-bit and 64-bit libraries can coexist on the same system. However, with `configure --prefix=/usr --libdir=/usr/lib64 && make`, the build breaks: ``` ... rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknow", "label": "medium", "label_id": 2} {"id": "rust_27255", "text": "ICE on invalid syntax \"impl A .. {}\" | I'm currently attempting to write a grammar reference from the parser source code, and noticed that there doesn't appear to be anything to prevent you from omitting `for` from `impl A for .. {}`, so I decided to give it a try and this happened: ``` cmd F:\\Programming\\Rust\\sandbox | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27257", "text": "Edge case on dead_code lint with unused variants | Using this code: https://github.com/retep998/winapi-rs/blob/lint-fail/src/winnt.rs#L2061-L2070 Build log: https://ci.appveyor.com/project/retep998/winapi-rs/build/1.0.327 Relevant warnings: ``` src\\winnt.rs:2062:5: 2062:34 warning: variant is never used: `UmsThreadInvalidInfoClas | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_27259", "text": "Implement a cap on lints on the rustc CLI | Tracking issue for https://github.com/rust-lang/rfcs/pull/1193 | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_27263", "text": "Error compiling for armv7-apple-ios | This is 607f74df2ad6b6fb32ce5b862a9e48a8c4afdad2. ``` rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7-apple-ios/lib/libstd warning: dropping unsupported crate type `dylib` for target `armv7-apple-ios` ../src/libstd/rand/os.rs:215:43: 215:52 error: found zero-size struct in fo", "label": "question", "label_id": 4} {"id": "rust_27264", "text": "Add a method to get the in6_addr from an Ipv6Addr? | How would you feel about adding a method to `std::net::Ipv6Addr` that returned either an `in6_addr` or (equivalently) a `[u16; 8]` in which the `u16`s are in network order? My motivation is that I am writing a binding to a C library which naturally wants an `in6_addr`; on the Rus", "label": "medium", "label_id": 2} {"id": "rust_27266", "text": "Lint against calling .clone() on an otherwise copyable value. | Certain types could start out as having contents that move and then switch to only copyable field, or could just be missing `#[deriving(Copy)]` initially. If `Copy` is implemented after that type has been used in a large codebase (there's a few cases in `rustc` itself), there wil | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_27268", "text": "ICE with closure in constant | ``` rust fn main() { const C: &'static Fn() = &||{}; } ``` ``` error: internal compiler error: no type for node 15: expr { } (id=15) in fcx note: the compiler unexpectedly panicked. this is a bug. ``` | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27269", "text": "Add set_limit() fn to std::io::Take | `std::io::Cursor` has a fn to update the position yet `Take` does not have a fn for setting the limit. Being able to update the limit is required for implementing various traits for Take. For example, `Read` works by updating the limit. I was hoping to implement `Buf` for `Take` | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_27271", "text": "Roman numeral plugin example fails to run | The roman numeral demo plugin compiles successfully, but fails with an ICE when run (the same as #26488). ``` rustc --version rustc 1.3.0-nightly (69ca01256 2015-07-23) ``` ``` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bu | labels: O-macos, A-syntaxext, A-plugins", "label": "high", "label_id": 1} {"id": "rust_27277", "text": "Stabilisation of `result_expect` | Introduced in RFC1119, covers the `Result::expect` method. An easy candidate for stabilisation as far as I can see, as it's just a single method that brings `Result`'s and `Option`'s APIs closer. (#26868) | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27279", "text": "rustc build warning: diagnostic code E0005 already used | Building the master branch yields this warning. ``` src/librustc/middle/check_match.rs:1050:5: 1059:6 warning: diagnostic code E0005 already used src/librustc/middle/check_match.rs:1050 for input in &decl.inputs { src/librustc/middle/check_match.rs:1051 is_refutable(cx, &*input.p", "label": "low", "label_id": 3} {"id": "rust_27281", "text": "ICE with Self in function bodies, associated types, and lifetimes | ## STR ``` Rust pub trait Trait<'a> { type T; fn foo(&self, s: &'a ()) -> &'a (); } impl<'a> Trait<'a> for () { type T = &'a (); fn foo(&self, s: &'a ()) -> &'a () { let t: Self::T = s; s } } fn main() {} ``` ## Result ``` :10:16: 10:23 error: internal compiler error: canno", "label": "high", "label_id": 1} {"id": "rust_27282", "text": "Can mutate in match-arm using a closure | **Update from pnkfelix**: Note that this is now fixed by NLL (see #50783). This bug just remains open because @pnkfelix thinks our policy is to keep NLL-fixed-by-NLL bugs open until we make NLL the default for `rustc`. ---- ## STR ``` Rust fn main() { match Some(&4) { None => {}, | labels: A-type-system, P-medium, T-compiler, I-unsound, A-NLL, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_27288", "text": "User facing messages MUST NOT say \"illegal\". | `error: illegal width`4`for float literal, valid widths are 32 and 64` `error: illegal recursive enum type; wrap the inner value in a box to make it representable [E0072]` You can almost always replace `illegal` with `invalid`. Since we're (probably) not breaking the law writing ", "label": "medium", "label_id": 2} {"id": "rust_27289", "text": "Closure fails Sized bound check when capturing struct with fat pointer | # Code ``` rust struct Foo { ptr: *mut T } unsafe impl Send for Foo {} impl Foo<[T]> { fn new_array(arr: &[T]) -> Self { loop {} } } fn do_something(f: F) {} fn main() { let x = Foo::new_array(&[0u8; 4]); do_something(", "label": "medium", "label_id": 2} {"id": "rust_27290", "text": "Build fails with musl | In make install I get: ``` prepare: tmp/dist/rustc-1.1.0-x86_64-unknown-linux-gnu-image/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-*.so ls: cannot access x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-*.so: No such file or directory install", "label": "medium", "label_id": 2} {"id": "rust_27293", "text": "Allow asserts in constant functions | Currently constant functions are not allowed to contain asserts. As asserts are base of defensive it would be nice if they were at least ignored - if nor changed into static asserts - in contexts when constant functions are required.", "label": "medium", "label_id": 2} {"id": "rust_27299", "text": "Mismatched register sizes in inline assembly produces incorrect code or crashes the compiler | ``` rust #![feature(asm)] fn main() { let res: u8; unsafe { asm!(\"addw %rax, %rbx\" : // output operands \"={rbx}\"(res) : // input operands \"{rax}\"(1u8), \"{rbx}\"(2u8) : // clobbers : // options ); } println!(\"{}\", res); } ``` If compiled without optimizations, the assembly is simpl", "label": "low", "label_id": 3} {"id": "rust_27301", "text": "Explicitly using `extern crate` in documentation examples gives unhelpful error | This would be more an enhancement than anything, but say if you have a library `bignum` and wanted to write an example in your docs `````` //lib.rs //... impl BigNum { //... /// Constructs a ... /// /// # Examples /// /// ``` /// extern crate bignum; /// use bignum::inits::Zero; | labels: T-rustdoc, A-diagnostics, T-dev-tools, C-bug", "label": "low", "label_id": 3} {"id": "rust_27302", "text": "improper_ctypes lint triggers for functions returning `()` | https://github.com/rust-lang/rust/commit/6fa17b43d351ed4f9093cf80f4044d1208044241 made the `improper_ctypes` lint trigger for tuples, but as far as I understand, returning `()` is equivalent to returning c_void, and therefore should be allowed. Here is an example: ``` Rust extern | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27303", "text": "Document the correct FFI equivalent to a C opaque struct | With recent changes to the `improper_ctypes` lint, it now rejects `#[repr(C)] struct Foo;` for representing a C opaque struct. ``` Rust #[repr(C)] pub struct Foo; extern \"C\" { pub fn foo(arg: *const Foo); } fn main() { } ``` ``` foo.rs:5:25: 5:28 warning: found zero-size struct i", "label": "medium", "label_id": 2} {"id": "rust_27306", "text": "Add BitAndNot | The ANDNOT operation is used at least as commonly as XOR and often has a more efficient implementation than x & !y. It introduces a symmetric function to OR for implementing clear-bit and set-bit on bit-vector-like classes. It should be given the same attention (including it's ow", "label": "medium", "label_id": 2} {"id": "rust_27312", "text": "Document Default Type Parameter Fallback | Now that https://github.com/rust-lang/rust/pull/26870 has landed we should document the behavior of the algorithm in the book. I would be happy to draft/review docs for this. cc @steveklabnik | labels: E-easy, E-mentor", "label": "low", "label_id": 3} {"id": "rust_27314", "text": "Confusing error message (compiler expects `fn` but found `fn`) on macro expantion | ``` rust macro_rules! test { ($Trait:ident, {$($items:tt)*}) => { trait $Trait { $($items)* } } } test!(Foo, { fn test() {} }); ``` Error message: ``` :4:15: 4:21 error: expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `fn` :4 $($items)* ^~~~~~ play | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27316", "text": "\"illegal hardware instruction\" when compiling code sample with E0391 error | While implementing explanation for E0391 error (unsupported cyclic reference between types/traits detected) realized, that Rust from master branch fails to compile the following code sample: ``` trait A : B {} trait B : A {} fn main() {} ``` Output: ``` $ rustc ../main/src/main.r | labels: I-ICE, E-needs-test", "label": "question", "label_id": 4} {"id": "rust_27320", "text": "unexpected panic in rustc | I can't show just a snippet of code to crash rustc but I made an special branch in my project with (what I think) is the minimum code required to crash rustc. This is the full version of the code: ludat/lurri@2ec32237c50b45c84d18f9dc22e008f8187d6724 This is the trimmed down versi | labels: E-easy, E-needs-test, E-mentor", "label": "low", "label_id": 3} {"id": "rust_27321", "text": "error: internal compiler error: unexpected panic while building nix-rust | Hello, for my latest PR for mq_unlink support in nix-rust the Travis build fails with a message that says: error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. The PR where this happes can be found here: https://github.com/carl | labels: I-ICE", "label": "question", "label_id": 4} {"id": "rust_27322", "text": "VecDeque has no `sort_by` method (should possibly have one to match Vec). | I just came across a use case for this while working on a visit order for the UI graph in conrod - its absence took me by surprise :smile_cat: Is there a particular reason this hasn't been implemented yet? Or has it just not _popped_ up yet (pun intended)? | labels: A-collections, T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_27323", "text": "impl Clone for Box | Just like `Box<[T]>`, Clone is also wanted for `Box`, but that can be much simpler: There is no panic issue, and it can use a simple ptr::copy of the data. Follow up after #25097", "label": "medium", "label_id": 2} {"id": "rust_27324", "text": "Generated debuginfo may apparently be ill-formed | Coming from an issue with kcov, here: https://github.com/SimonKagstrom/kcov/issues/105 Apparently, the debuginfo generated in rust executables causes kcov to sometimes put breakpoints in the middle of some instructions. According to kcov developper, it is possibly because the deb | labels: A-debuginfo, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27328", "text": "Test examples in extended diagnostics | The [extended error explanations](https://github.com/rust-lang/rust/blob/master/src/librustc/diagnostics.rs) are filled with amazing examples, but they are not validated in any way. Having these tested would be a great extension to the test suite and ensure that they do not becom | labels: A-testsuite, T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27329", "text": "Cargo/rustc fails to compile a project when it is located on one specific Windows drive | I get unexpected errors when running 'cargo build' on a very simple project that basically just imports 'num' crate. The problem happens when I try to compile a project with this Cargo.toml (I can reproduce the problem with just this file in the directory and nothing else.) Cargo | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_27332", "text": "Remove morestack dependency. | As we know the concept of segmented stack has been already abandoned. But for freestanding build the Rust compiler still complains about missing _libmorestack.a_: > rustc --crate-type rlib,staticlib --target x86_64-unknown-linux-gnu -C opt-level=3 -C no-stack-check -Z no-landing-", "label": "medium", "label_id": 2} {"id": "rust_27333", "text": "LLVM crash with SIMD types and inline asm | I wrote some code which extracts the two halves of a u64x4, calls some arm neon inline assembly on each half, and combines them again. Trying to compile that code for arm crashes the compiler deep in the LLVM code. I had previously used the exact same inline assembly without any | labels: A-LLVM, P-low, E-mentor, A-inline-assembly, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_27335", "text": "Make OOM a lang item | Currently `alloc::oom` just calls `intrinsics::abort` making the program look like it faulted, when really we killed it in a controlled manner. The reason it does that is that liballoc only assumes we have an allocator and no other OS/runtime. However if oom was a lang item, we c", "label": "medium", "label_id": 2} {"id": "rust_27336", "text": "Tracking Issue for RFC 213: Default Type Parameter Fallback | 2024-07-15: This feature (`default_type_parameter_fallback`) is slated for removal, but that is currently blocked on too many [crater regressions](https://github.com/rust-lang/rust/pull/127655#issuecomment-2228285460). ----- EDIT: this issue has been stalled on disagreements abou | labels: B-RFC-approved, T-lang, B-unstable, B-RFC-implemented, C-tracking-issue, F-default_type_parameter_fallback", "label": "high", "label_id": 1} {"id": "rust_27337", "text": "Compiler crash on wrong enum definition | I accidentially defined an enum in the wrong way, compiler crashed just after wrinting error messsage. I tried this code: ``` rust #![crate_name = \"Test\"] #![crate_type = \"dylib\"] #[repr(C)] enum Foo { Foo_X = 0, Foo_Y = Foo::Foo_X, } #[repr(C)] enum Bar { Bar_X = 0, Bar_Y = Foo: | labels: I-ICE", "label": "question", "label_id": 4} {"id": "rust_27340", "text": "derive(Copy) on tuple struct with non-Copy field uses unclear \"\" | ``` rust struct Foo; #[derive(Copy, Clone)] struct Bar(Foo); fn main() {} ``` ``` :2:10: 2:14 error: the trait `Copy` may not be implemented for this type; field `` does not implement `Copy` [E0204] :2 #[derive(Copy, Clone)] ^~~~ ``` It'd be nice to men | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27344", "text": "Compiler UI/UX Design Guidelines Document | There's a lot of compiler UI and UX rules that exist in the developer mindshare, but are not documented anywhere. They aren't really Rust code style guidelines, since they only apply to the compiler (and possibly compiler plugins), so we really need to have another document for t", "label": "medium", "label_id": 2} {"id": "rust_27347", "text": "difficulty with binding example in patterns.md | The second example for the bindings contains advanced syntax that the reader has not seen (at leat to the best of my knowledge when skipping \"learn rust\"). Those bits: ``` rust let mut x: Option = Some(Person { name: Some(name) }); match x { Some(Person { name: ref a @ So", "label": "medium", "label_id": 2} {"id": "rust_27354", "text": "Path join() not joining correctly with relative path: \"./something\" | When you join a path with a relative path like `./something` it does not strip the `./` For example ([Playpen](https://play.rust-lang.org/?gist=004728342ced073706bd&version=nightly)) ``` rust fn main() { let base = PathBuf::from(\"/some/path\"); let relative = PathBuf::from(\"./some", "label": "medium", "label_id": 2} {"id": "rust_27356", "text": "fs::Path.PathExt::exists accesses uninitialized variable | When running this test program ``` #![feature(path_ext)] use std::path::Path; use std::fs::PathExt; fn main() { println!(\"Hello, world!\"); Path::new(\"/dev/disk/by-uuid/\").join(\"foo\").exists(); println!(\"Hello, world!\"); } ``` in valgrind, I see the following error message: ``` ==", "label": "medium", "label_id": 2} {"id": "rust_27357", "text": "split_at_mut does sketchy things with aliasing | The problematic function: ``` Rust fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) { unsafe { let self2: &mut [T] = mem::transmute_copy(&self); (ops::IndexMut::index_mut(self, ops::RangeTo { end: mid } ), ops::IndexMut::index_mut(self2, ops::RangeFrom { start: mid ", "label": "medium", "label_id": 2} {"id": "rust_27359", "text": "freebsd32 test failures | ``` thread '' panicked at 'assertion failed: `(left == right)` (left: `140737488355328`, right: `3`)', ../src/libstd/fs.rs:2036 test fs::tests::open_flavors ... FAILED thread '' panicked at 'assertion failed: `(left == right)` (left: `140737488355328`, right: `3", "label": "medium", "label_id": 2} {"id": "rust_27361", "text": "Confusing error message with unsafe functions in extern blocks | This code produces \"error: expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`\": ``` rust extern { unsafe fn foo(); } ``` | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27362", "text": "rustdoc: `const fn` not displayed for reexported docs | Doc inclusion / doc reexport does not show `const fn` properly (example: std::cell::Cell::new). - Reexport metabug: rustdoc: Pain points of reexports #24305 - const fn tracker: #24111 | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_27363", "text": "Cargo.toml confused by [dependencies.url] | Using Cargo.toml [dependencies.url] in error against some named crate.io, will lead to compile errors, rather than suggesting some \"failed to parse\" error against Cargo.toml. For example: ``` [dependencies.url] regex = \"*\" git = \"https://github.com/servo/rust-url\" ``` will lead t", "label": "medium", "label_id": 2} {"id": "rust_27366", "text": "rustc panic | Unfortunately, I have no idea what causes this panic. I wish I could give more useful info. Here is the backtrace: ``` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.", "label": "high", "label_id": 1} {"id": "rust_27367", "text": "Nightly panics when using associated constant in array size | In the playpen (Mode: Debug, Channel: Nightly) I was playing with associated constants when this code made the compiler panic: ``` rust #![feature(associated_consts)] use ::std::marker::PhantomData; trait Num { const VAL: usize; fn val() -> usize; } struct N1; impl Num for N1 { c", "label": "high", "label_id": 1} {"id": "rust_27372", "text": "readelf complains that .note.rustc is malformed | After building rustc 1.1.0, if I run `readelf --section-headers --note` over the shared libraries produced, I see output like the following: ``` $ readelf --section-headers --note x86_64-unknown-linux-gnu/stage2/lib/libarena-e9599659.so There are 30 section headers, starting at o | labels: O-linux", "label": "medium", "label_id": 2} {"id": "rust_27376", "text": "Some old doc should be removed | https://doc.rust-lang.org/stable/getopts/index.html People might see this page through old link, so these old pages should be removed. We may need `make clean` here, I guess..", "label": "medium", "label_id": 2} {"id": "rust_27377", "text": "Error E0399 regression on nightly from beta. | I have found that with a trait of the form ``` trait Foo { type A = (); fn get_a(&self) -> Option { None } type B = (); fn get_b(&self) -> Option { None } } impl Foo for () { type A = (); } ``` I get the following error message on nightly (as of the time of this", "label": "high", "label_id": 1} {"id": "rust_27381", "text": "Rustc crashed with stack overflow error | Test code is in https://github.com/zonyitoo/coroutine-rs with branch `boost-stackoverflow`. `cargo build` should be ok, but if you run `cargo run --example simple`, then it will report ``` Compiling coroutine v0.3.1 (file:///Users/zonyitoo/Projects/coroutine-rs) thread 'rustc' ha | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27384", "text": "Bad impl of the new placement-in suggests to use `ref` where it is invalid | When you implement new placement protocol traits invalidly and consume the collection you’re placing into such as like this: ``` rust let mut x = MyVec(Vec::new()); in x {42}; x ``` the code yields ``` vec-emplace.rs:56:5: 56:6 error: use of moved value: `x` [E0382] vec-emplace.r | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27389", "text": "Tracking issue for changing the global, default allocator (RFC 1974) | Tracking issue for ~~https://github.com/rust-lang/rfcs/pull/1183~~ https://github.com/rust-lang/rfcs/pull/1974 Known bugs: * [ ] The `#[global_allocator]` attribute doesn't work in modules #44113 Current status: * [x] Implemented in https://github.com/rust-lang/rust/pull/42727 * | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "low", "label_id": 3} {"id": "rust_27391", "text": "Compiler allows for wrong struct initialization | By mistake I used recursively `Default::default()` inside `Default::default()` implementation. Compilation suceeded, but program crashed on illegal instruction. I tried this code: ``` rust struct A { x: i32, } impl Default for A { fn default() -> A { A { x: 1 } } } struct B { x: ", "label": "medium", "label_id": 2} {"id": "rust_27394", "text": "Tracking issue for `no_std` (RFC #1184) | https://github.com/rust-lang/rfcs/pull/1184 | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_27395", "text": "Assembly private symbols redefinition error | On playpen nightly ``` rust #![crate_type=\"lib\"] #![feature(asm)] fn main() { unsafe { routine() } } pub unsafe fn routine() { asm!(\"mov ecx, 0xFF .loop: loop .loop\" : // no outputs : // no inputs : \"ecx\" : \"intel\"); } pub unsafe fn routine2() { routine(); // causes inlining, dup | labels: P-low, A-inline-assembly, T-compiler", "label": "low", "label_id": 3} {"id": "rust_27396", "text": "std::io::BufReader reads incorrect data | Steps to reproduce: 1) Download test TGA image at https://drive.google.com/file/d/0B7COwFox9fT8Wk9WSk5iMWRaRFk/view?usp=sharing . 2) Past this code in `bug_example.rs`: ``` Rust use std::fs::File; use std::io::BufReader; use std::io::Read; use std::path::Path; fn main() { let pat", "label": "medium", "label_id": 2} {"id": "rust_27401", "text": "Drop flags on the stack not reinitialized in loops | It looks like that when a local variable is initialized in a loop and dropped in the same loop, the stack local drop flag for that local isn't reinitialized to \"not dropped\" when the loop runs after the first time. Concretely, this test passes on stable and fails on nightly right | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_27402", "text": "rustc does not add the LIBPATH for ucrt.lib to the MSVC command line. | When `cargo build` is used outside of an VS2015 {x86,x64} Native Tools Command Prompt, I receive this error during linking: `rustc: LINK : fatal error LNK1104: cannot open file 'ucrt.lib'` in librustc_trans/back/msvc/mod.rs: ``` rust // The MSVC linker uses the LIB environment va", "label": "medium", "label_id": 2} {"id": "rust_27403", "text": "conflicting implementations when attempting to `impl Into for ArbitraryStructWithNoOtherImpls` | At the very least (if this failure is expected), the error needs to be improved to actually point to the conflicting impl rather than simply printing the crate name and repeating the same function output that conflicts (if it is for some reason not possible to print better info a | labels: C-enhancement, A-diagnostics, P-low, T-lang", "label": "low", "label_id": 3} {"id": "rust_27404", "text": "Rustbook isn't stripping %'s | https://doc.rust-lang.org/nightly/adv-book/ and https://doc.rust-lang.org/nightly/book/ Show the title rendered twice, once as a header, once as `% ...`", "label": "medium", "label_id": 2} {"id": "rust_27408", "text": "Allow late environment capture for closures | I suggest to allow a closure to capture their environment either at its call site or whenever a reference to the closure leaves the scope in which it can access the environment. This would allow the following code which is a very common use case of lambdas and is currently reject", "label": "medium", "label_id": 2} {"id": "rust_27409", "text": "Poor report of macro_rules! error message | rustc 1.3.0-dev (04badd6a9 2015-07-25) A macro_rules! syntax error reported at expansion site instead of macro definition: ``` macro_rules! sum { ($h:expr) => $h; ($h:expr, $($t:expr),*) => ($h + sum!($($t),*)); } fn main() { let i = sum!(2,3,4); println!(\"{}\", i); } ``` Error me | labels: A-diagnostics, A-macros", "label": "medium", "label_id": 2} {"id": "rust_27412", "text": "Bikeshed \"The Advanced Rust Programming Language\" as a name | @dherman suggested this iirc -- but I can't remember. @brson is concerned that it is too similar Originally it was called _The Unsafe Rust Programming Language_ since it largely focuses on unsafe code and the stuff that matters to it.", "label": "medium", "label_id": 2} {"id": "rust_27415", "text": "Weird statement macro expansion | ``` rust macro_rules! e { () => ( drop(1) drop(2) ) } fn main() { e!(); } ``` This is currently accepted; I would normally expect it to complain about a missing semicolon, or something like that. | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_27420", "text": "[wish list] Confusing error message E0308 when using two diff versions of a library | I came across this confusing error message: ``` src/main.rs:17:37: 17:67 error: mismatched types: expected `&nalgebra::structs::vec::Vec3`, found `&nalgebra::structs::vec::Vec3` (expected struct `nalgebra::structs::vec::Vec3`, found a different struct `nalgebra::structs", "label": "medium", "label_id": 2} {"id": "rust_27422", "text": "Option `map_or` and `map_or_else` type is inconsistent with `map` | `map` method type is ``` fn map(self, f: F) -> Option where F: FnOnce(T) -> U ``` `map_or` method type is ``` fn map_or(self, default: U, f: F) -> U where F: FnOnce(T) -> U ``` `map_or_else` method type is ``` fn map_or_else(self, default: D, f: F) -> U wh", "label": "medium", "label_id": 2} {"id": "rust_27425", "text": "Is there plan to add `Result.expect_err` method? | `Result` has `unwrap` and `expect` method yielding `Ok`, but only has `unwrap_err` yielding `Err`, there isn't `expect_err` method.", "label": "medium", "label_id": 2} {"id": "rust_27427", "text": "`move_val_init` signature change broke freebsd32 build | I don't quite understand what's going on here, but it looks like intrinsics changed under us. From [`freebsd10_32` build 151](http://buildbot.rust-lang.org/builders/auto-freebsd10_32-1/builds/151/steps/compile/logs/stdio): ``` rustc: i686-unknown-freebsd/stage0/lib/rustlib/i686-u", "label": "medium", "label_id": 2} {"id": "rust_27428", "text": "Getting started in the book should state how to get a backtrace | This is the most annoying and most useless error message ever if you don't know how to get a backtrace. The docs should state how to get one. Without a backtrace it's only helpful if you already know where the error isn't always the case. This: ``` rust vec![1, 2][7]; ``` Returns", "label": "low", "label_id": 3} {"id": "rust_27429", "text": "Confusing Error Message When Doc Comment inside Array | Probably a few other places where it's also confusing. Should probably state something like 'unexpected doc comment. A doc comment must precede an item`. ``` rust fn main() { let a = [1.0, 1.0 /** b */, 1.0]; } ``` ``` :1:31: 1:39 error: expected one of `,`, `.`, or an oper | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27430", "text": "match of associated_const from const_fn | I am using an associated constant in a match pattern. The associated constant was initiated with a const function. https://play.rust-lang.org/?gist=0a3ce02daba0b2226cac&version=nightly ``` rust #![feature(associated_consts, const_fn)] struct A(u32); impl A { const fn new() -> A { | labels: I-ICE, A-associated-items", "label": "high", "label_id": 1} {"id": "rust_27433", "text": "Invalid error (E0425) reported | In the following code: ``` Rust fn main() { let foo = 42u32; const FOO : u32 = foo; } ``` We have the following errors: ``` Shell :3:23: 3:26 error: attempt to use a non-constant value in a constant [E0435] :3 const FOO : u32 = foo; ^~~ :3:23: 3:26 error: unreso | labels: A-diagnostics, E-needs-test", "label": "medium", "label_id": 2} {"id": "rust_27435", "text": "the type placeholder `_` is not allowed within types on item signatures should hint at generics | The following signature yields the mentioned error ``` rust fn shuffle(args: Vec<_>) -> Vec<_> ``` it should be replaced by ``` rust fn shuffle(args: Vec) -> Vec ``` There should be an error hint suggesting this change. | labels: C-enhancement, A-diagnostics, P-medium, E-medium, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_27442", "text": "VecMap Debug implementation should use debug_map | Right now, it doesn't support pretty printing as a result.", "label": "question", "label_id": 4} {"id": "rust_27443", "text": "compiler error on crate hyper 0.6.6 (solicit v.0.4.0) | I just tried to include extern crate hyper = \"*\" -> 0.6.6 when crate starts building there is an internal compiler error: Cargo.toml [dependencies] hyper=\"*\" $ rustc --version rustc 1.3.0-nightly (freebsd) $ cargo build Compiling solicit v0.4.0 src/libcore/iter.rs:804:35: 804:42 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27445", "text": "Warn on redundant 'as Foo' statements | ``` rust fn main() { let x: i8 = 42; let y: i8 = x as i8; println!(\"y: {}\", y); } ``` This doesn't generate any warnings from rustc, even though the `as i8` is redundant here. I bump into this occasionally when refactoring, so it would be nice if rustc could help find these sitau", "label": "medium", "label_id": 2} {"id": "rust_27446", "text": "rustc panics if the terminal's terminfo is invalid | If the terminfo for my terminal is malformed, rustc panics with ``` thread '
' panicked at 'assertion failed: `(left == right)` (left: `0`, right: `2`)', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libterm/terminfo/parser/compiled.rs:315 ``` The | labels: A-frontend, E-needs-test", "label": "medium", "label_id": 2} {"id": "rust_27448", "text": "Defining a public method on a private type alias causes linking failures | Suppose we have a crate named `c`. **src/lib.rs**: ``` rust pub struct A(T); type B = A<()>; impl B { pub fn new() -> Self { A(()) } } ``` ``` text src/lib.rs:5:5: 7:6 warning: method is never used: `new`, #[warn(dead_code)] on by default src/lib.rs:5 pub fn new() -> Self { sr", "label": "medium", "label_id": 2} {"id": "rust_27449", "text": "ICE when comparing two *const Trait for equality | Hey all, I'm trying to see if two &Trait refer to the same object. It sounds like the correct way to do this is by casting to `*const Trait` and comparing those pointers for equality, however this produces an ICE. Here's a simple [repro on playpen](http://is.gd/c4UIFd) and pasted | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27450", "text": "poor error message when casting from fat raw pointer to usize | [playpen](https://play.rust-lang.org/?code=trait%20Num%20%7B%7D%0Aimpl%20Num%20for%20i32%20%7B%7D%0A%0Afn%20main%28%29%20%7B%0A%20%20%20%20%260i32%20as%20*const%20Num%20as%20usize%3B%0A%7D%0A&version=beta) ``` rust trait Num {} impl Num for i32 {} fn main() { &0i32 as *const Num | labels: E-easy, A-diagnostics", "label": "high", "label_id": 1} {"id": "rust_27452", "text": "Entry point `_ZSt24__throw_out_of_range_fmtPKcz` not found in `libstdc++6.dll` | I cloned and compiled https://github.com/steveklabnik/rustbook on Windows 32bits. When trying to run the `rustbook.exe` executable, I get an error about entry point `_ZSt24__throw_out_of_range_fmtPKcz` not found in `libstdc++6.dll` (the exact message is in french for me). Happens", "label": "medium", "label_id": 2} {"id": "rust_27454", "text": "Rust assumes PATH_MAX is not a lie in a few places | See http://insanecoding.blogspot.ca/2007/11/pathmax-simply-isnt.html for some background. Basically, `PATH_MAX` just doesn't work. Currently. Rust uses `PATH_MAX` in a few important places. ./src/libstd/sys/unix/fs.rs:377:`let mut buf = vec![0;libc::PATH_MAX as usize];` ./src/lib | labels: P-medium", "label": "medium", "label_id": 2} {"id": "rust_27455", "text": "Compiler segfault / illegal instruction: llvm: Assertion `Ty && \"Invalid GetElementPtrInst indices for type!\"' failed. | ## Environment #### Local Environment ``` Darwin genesis.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64 rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14) ``` #### Playpen Environment This was tested 01/07/20 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27456", "text": "Warn for functions that should 'obviously' be unsafe | As a noob writing FFI code I have more than once made a mistake something like this ``` rust fn foo(pointer: *const u32) -> u32 { unsafe { *pointer + 1 } } ``` Clearly `foo()` should have been marked unsafe, as a caller can demonstrate by writing the following safe code: ``` rust", "label": "medium", "label_id": 2} {"id": "rust_27457", "text": "Possible error about variance in the nomicon | [In the paragraph about the variance of `&mut T`](https://github.com/rust-lang/rust/blame/master/src/doc/tarpl/subtyping.md#L97) > (...) If `&mut T` was variant over T, then `&mut &'a str` would be a subtype of `&mut &'static str`, > **since `&'a str` is a subtype of `&'static st", "label": "medium", "label_id": 2} {"id": "rust_27462", "text": "trim and related giving unexpected behavior on strings with many nulls | ``` #[test] fn validate_trim() { let s: &str = \"QUIT\\r\\n\"; let s2: &str = \"\\x51\\x55\\x49\\x54\\x0d\\x0a\"; let buf: [u8; 6] = [ 81u8, 85u8, 73u8, 84u8, 13u8, 10u8 ]; let buf2: [u8; 16] = [ 0x51u8, 0x55u8, 0x49u8, 0x54u8, 0x0Du8, 0x0Au8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; let input: &str ", "label": "medium", "label_id": 2} {"id": "rust_27463", "text": "io::Take's BufRead::fill_buf always attempts to fill the inner buffer | Even if self.limit is 0, fill_buf will attempt to read from the underlying BufRead, possibly causing additional blocking read(2) calls from split/read_until/etc: ``` use std::os::unix::io::FromRawFd; use std::fs::File; use std::io::BufReader; use std::io::BufRead; use std::io::Wr", "label": "medium", "label_id": 2} {"id": "rust_27465", "text": "Stabilization of weak pointers | Currently, both `alloc::rc::Weak` and `alloc::arc::Weak` are unstable. The somewhat vague reason for this is that _weak pointers may not belong in this module_. Now this has been addressed multiple times in #24028 and I have been observing this situation for a few months. However", "label": "question", "label_id": 4} {"id": "rust_27466", "text": "std::ptr::null() should perhaps use `llvm::ConstantPointerNull` rather than `0 as *const T` | - http://llvm.org/docs/doxygen/html/classllvm_1_1ConstantPointerNull.html But I know of no platform where `0 as *const T` is wrong! Maybe not that important... - http://stackoverflow.com/questions/12126252/what-does-nvidia-gpu-do-with-device-memory-0x0 - https://software.intel.co", "label": "question", "label_id": 4} {"id": "rust_27467", "text": "link_section attribute seems to be broken | I compile the code below: ``` rust #[link_section = \".multiboot_header\"] pub static MULTIBOOT_HEADER: multiboot::Header = multiboot::Header { magic: multiboot::HEADER_MAGIC, flags: HEADER_FLAGS, checksum: (-((multiboot::HEADER_MAGIC + HEADER_FLAGS) as i32) as u32), header_addr: 0", "label": "medium", "label_id": 2} {"id": "rust_27468", "text": "Compiler outputs error in pieces, creating spaghetti output. | Output: ``` $ cargo test -- --nocapture Compiling unrar v0.1.0 (file:///Users/danyel/workspace/rust/unrar) src/archive.rs:151:17: 151:21src/archive.rs:151:17: 151:21 error: error: expected one of `!`, `.`, `::`, `;`, `{`, `}`, or an operator, found `Some`expected one of `!`, `.`, | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27471", "text": "docs: add `meta` to the list of valid designators | The documentation [says](https://doc.rust-lang.org/reference.html#macro-by-example): > Valid designators are item, block, stmt, pat, expr, ty (type), ident, path, tt (either side of the => in macro rules). `meta` is presumably a valid designator as well. Regards, Ivan", "label": "low", "label_id": 3} {"id": "rust_27472", "text": "into_ascii_lowercase shouldn't be deprecated | We really really need it for performance in Servo.", "label": "medium", "label_id": 2} {"id": "rust_27477", "text": "Expressions involving blocks do not parse well | ``` rust 0; // OK 0 + 1; // OK {0} + 1; // Error: unexpected token: `+` ({0} + 1); // OK ``` @copy and @durka found this issue on IRC. I baked cookies for them! Also, @tsion found this interesting corner case: ``` // Is `*` a multiplication? Or a dereference? Currently it parses ", "label": "medium", "label_id": 2} {"id": "rust_27478", "text": "A block evaluated as a function is not directly callable | ``` rust fn f() {} f(); // OK {f}(); // Error: expected `()`, found `fn()` let a = {f}; a(); // OK ``` Another corner case found here! | labels: A-diagnostics, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27479", "text": "Link failure due to exporting function with a non-exported return type | This code snippet causes a link failure. I am guessing it is because the return type of foo is not publicly exported from the crate it is causing a link failure in the test. I tried this (reduced) code: lib.rs ``` rust mod helper { pub struct Foo; impl Foo { pub fn baz(&self) { }", "label": "medium", "label_id": 2} {"id": "rust_27480", "text": "ICE in borrow checker | https://play.rust-lang.org/?gist=23de822c03921663ae66&version=nightly . Error message: ``` :110:25: 110:60 error: cannot assign to `*entry` because it is borrowed :110 *entry = FragmentRepr::Enum(discrs); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: in expansion of if le | labels: I-ICE, A-borrow-checker", "label": "high", "label_id": 1} {"id": "rust_27481", "text": "Overflow error for valid trait implementation | Playpen: https://play.rust-lang.org/?gist=8e86843e775a046c9cb7&version=stable AFAICT, the impl shouldn't cause an overflow error. | labels: A-trait-system", "label": "medium", "label_id": 2} {"id": "rust_27482", "text": "Internal compiler error with &[[bool]] | Hi! When I was writing my own version of Game of Life, I made new function which caused message: ``` C:\\Users\\User\\projects\\testi2>cargo build Compiling testi2 v0.1.0 (file:///C:/Users/User/projects/testi2) ... some warnings... error: internal compiler error: unexpected panic not", "label": "high", "label_id": 1} {"id": "rust_27484", "text": "buggy code generated when initializing a [Vec<_>;..] | The following code non-deterministically either works, goes into an infinite loop, or seg-faults, on both my mac environment and on https://play.rust-lang.org/, in all three channels. However, only in Debug mode -- it works fine in all three cases in Release. It also works fine i", "label": "medium", "label_id": 2} {"id": "rust_27485", "text": "rustc produces N^2 error messages for multiple mutable borrows | ``` rust fn main() { let mut x = 1; let mut addr; loop { match 1 { 1 => { addr = &mut x; } 2 => { addr = &mut x; } 3 => { addr = &mut x; } 4 => { addr = &mut x; } 5 => { addr = &mut x; } 6 => { addr = &mut x; } 7 => { addr = &mut x; } 8 => { addr = &mut x; } 9 => { addr = &mut x; | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27486", "text": "ICE when attempting to borrow non-existent item associated with type for argument | The following code generates an internal compiler error: ``` rust struct Mozilla; fn some_function(c: &Mozilla) {} fn main() { some_function(&Mozilla::PHANTOM); } ``` As far as I can tell: - One must be attempting to borrow (`&`) the value - It must be a non-existent name associa", "label": "high", "label_id": 1} {"id": "rust_27487", "text": "Borrow checker gets confused with a mutable pointer which should be moved | ``` rust pub struct FragmentRepr(Vec); pub fn accepted(mut entry: &mut FragmentRepr) { loop { let FragmentRepr(ref mut discrs) = *{entry}; entry = &mut discrs[0]; } } pub fn rejected(mut entry: &mut FragmentRepr) { loop { let FragmentRepr(ref mut discrs) = *entry; e | labels: A-borrow-checker, C-bug, fixed-by-NLL", "label": "medium", "label_id": 2} {"id": "rust_27489", "text": "unescaped quotation marks in macro-processed doc comments | It seems like one of the recent fix to macro handling of doc comments (perhaps [this](https://github.com/rust-lang/rust/pull/26777)) was a bit overzealous in not parsing the string, so that embedded quotation marks don't get escaped. It doesn't show up unless `stringify!` is call | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27492", "text": "rust-release-1.1.0 cannt configure on osx 10.11(beta 4) | the ./configure output is : configure: looking for configure programs configure: found program cmp configure: found program mkdir configure: found program printf configure: found program cut configure: found program head configure: found program grep configure: found program xarg", "label": "medium", "label_id": 2} {"id": "rust_27497", "text": "is_instantiable check is broken by nested types | ## STR ``` Rust struct Foo(T, Box>>); struct Bar(T); fn main() { println!(\"Hello, world!\"); } ``` ## Results `Foo` is uninhabitable, but the uninhabitability error doesn't trigger. Removing one of the `Bar`-s does make it trigger. This is rather suprising. Th | labels: I-needs-decision, T-lang", "label": "medium", "label_id": 2} {"id": "rust_27501", "text": "still some unneeded integer suffixes in the docs | I noticed recently that the FFI chapter still has `1u32` in places, from before integer fallback existed. That, along with any other suffixes, should be removed. (I'm not sure how many there are, exactly, but looking around for more while those get fixed is a Good Idea)", "label": "low", "label_id": 3} {"id": "rust_27506", "text": "PathBuf set_extension returns bool, builder pattern impossible | I think that returning bool when calling `set_extension` is weird because it breaks the builder pattern that you have with most other methods. For example I wanted to use it in my project, I have to change the extension from `.md` to `.html`. My first try was to do it like this: ", "label": "medium", "label_id": 2} {"id": "rust_27510", "text": "\"Concurrency\" section comes before \"Traits\" in TRPL | The [Concurrency](http://doc.rust-lang.org/nightly/book/concurrency.html) chapter of TRPL gives some background on `Send` and `Sync`, describing them as traits and giving a summary of their properties and how they allow preservation of memory safety in a concurrent context. But t", "label": "question", "label_id": 4} {"id": "rust_27511", "text": "repr C newtype for empty enum | It's currently legal to define the following type, even though `repr(C)` on empty enums is forbidden. ``` rust enum No {} #[repr(C)] struct Yes(No); ``` | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_27513", "text": "Missing information when spanning E0282 | The function call note_obligation_cause seems to be missing after [this line](https://github.com/rust-lang/rust/blob/master/src/librustc/middle/traits/error_reporting.rs#L349-L352) but is present [here](https://github.com/rust-lang/rust/blob/master/src/librustc/middle/traits/erro | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27514", "text": "Failing debuginfo test | The test that was restored in #27500 fails for me: ``` failures: ---- [debuginfo-gdb] debuginfo/gdb-pretty-struct-and-enums.rs stdout ---- NOTE: compiletest thinks it is using GDB version 7.7 error: line not found in debugger output: $13 = Some = {\"abc\"} status: exit code: 0 comm | labels: A-debuginfo, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27517", "text": "Add `ByNeed` and `Predicate` traits | #18424 \"Implement collections reform\" was closed with one part left not implemented yet: > Tracking issue for rust-lang/rfcs#235, there are a number of sub-issues associated with this: > > [...] > > Backwards compatible changes that will require additional language features: > - | labels: B-RFC-approved, T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_27522", "text": "Bad span for self type | The high end of the span of `&SomeType` in ``` rust trait Foo { fn handler(self: &SomeType); } ``` is incorrectly set to `BytePos(0)`. | labels: A-diagnostics, A-trait-system, E-needs-test", "label": "medium", "label_id": 2} {"id": "rust_27523", "text": "docs: clarify `PhantomData` vs \"phantom types\" statement | In the documentation for [`PhantomData`](https://doc.rust-lang.org/stable/core/marker/struct.PhantomData.html), it states that: \"Though they both have scary names, PhantomData and \"phantom types\" are unrelated.\" This seems to not be an accurate description of the relationship ", "label": "low", "label_id": 3} {"id": "rust_27526", "text": "Docs: nomicon: missing word in send-and-sync.md | In `send-and-sync.md`, there is a sentence where some word(s?) seem to be missing: > This means that they are unsafe to implement, and other unsafe code can that they are correctly implemented. (I suppose it's something like \"other unsafe code can ASSUME that...\"?) r? @Gankro PS:", "label": "low", "label_id": 3} {"id": "rust_27532", "text": "Nullable field optimization does the Wrong Thing when faced with associated types | ## STR ``` Rust use std::mem; trait Mirror { type Image; } impl Mirror for T { type Image = T; } struct S1(::Image); struct S2(T); fn main() { println!(\"with: {}\", mem::size_of::>>()); println!(\"without: {}\", mem::size_of::>>())", "label": "medium", "label_id": 2} {"id": "rust_27537", "text": "Document interaction of std APIs with OS syscalls | @aturon and I have long had the desire to audit all of our various `std::{io, process, env, fs, os}` APIs with what they're actually doing on all platforms. This is very helpful for getting more information about the precise semantics of the API in various corner cases as well as", "label": "medium", "label_id": 2} {"id": "rust_27541", "text": "Rust does not dynamically export functions in Android shared library | I've been trying to compile Rust for Android and call exported JNI functions directly from Java, without a C++ shim in between. I found that if I marked a function as `#[no_mangle] pub extern \"C\"` it would show up in the symbol table just like JNI exported functions in C++, but i | labels: O-android", "label": "medium", "label_id": 2} {"id": "rust_27543", "text": "Rustc produces bad binaries on Fedora 14, Centos 6.6, 32 bit | I think it's because of the TLS setup not working properly Here's a (sorry, screenshot) of vimdiff of readelf of a working and non-working binary https://i.imgur.com/zfdDYss.png -- Both compiled with the same rustc binary, but different host OSes. I believe this is related to htt | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_27554", "text": "Explicit OIBIT impls hide the default impls | ``` rust #![allow(dead_code)] trait Foo {} struct A(T); unsafe impl Sync for A {} // Comment this line and the code compiles trait IsSync: Sync {} struct X; impl IsSync for A {} // error: the trait `Foo` is not implemented for the type `X` [E0277] fn main() {} `` | labels: A-type-system, A-trait-system, P-medium, T-lang", "label": "medium", "label_id": 2} {"id": "rust_27559", "text": "Misleading \"unused\" warning message | We got the following warning message: ``` Shell warning: variant is never used: `Foo`, #[warn(dead_code)] on by default ``` For this code: ``` Rust enum Something { Foo, NotFoo } fn main() { match Something::NotFoo { Something::Foo => {} _ => {} } } ``` This warning could mislead | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_27560", "text": "Span output should be shortened to three lines (w/ ellipsis) unless --verbose | The compiler reports spanned warnings and errors with the full span of the responsible code. While that makes it abundandly clear where the error arose, it also makes the output very verbose by default. Since we have a `--verbose` command line flag, I propose that the compiler sh | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27561", "text": "Invalid error message for E0423 | Example: ``` Rust struct Foo { x: u8 } println!(\"{:?}\", Foo); // error: `Foo` is a structure name, but this expression uses it like a function name ``` The error message is incorrect. | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27567", "text": "pretty test should not specify --crate-type=lib when typechecking | Since the early days of pretty tests (77be30fa737c6b55faf3a52fbd2050f5b35ebb02) they were compiled as libraries so that they did not require a main function. By now they also run on all the run pass test, which all have a main and there is (or soon will be) at least one run pass ", "label": "medium", "label_id": 2} {"id": "rust_27569", "text": "End of macro invocation before expected produces EOF | ``` rust fn main() { let message = \"world\"; println!(\"Hello, {}\", message/); } ``` This gives the following compile error: ``` :3:34: 3:35 error: unexpected token: `` :3 println!(\"Hello, {}\", message/); ^ ``` I think this is slightly misleading: it's not an EOF a | labels: C-enhancement, A-diagnostics, A-parser, A-macros", "label": "low", "label_id": 3} {"id": "rust_27570", "text": "mem::transmute is too restrictive | Because `mem::transmute` checks its constraints before monomorphization, it fails for types containing fields whose type is determined by a generic parameter: > cannot transmute to or from a type that contains unsubstituted type parameters It's great that it attempts to catch err", "label": "medium", "label_id": 2} {"id": "rust_27578", "text": "Tracking issue for the `use_group_as` RFC | Tracking issue for rust-lang/rfcs#1219. Intention is to permit syntax like: ``` rust use std::io::{ Error as IoError, Read, Write } ``` the semantics of which are fairly self-explanatory. | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_27579", "text": "Projections, lifetimes, and WF tracking issue (RFC 1214) | ### Tracking issue for rust-lang/rfcs#1214 - [x] rust-lang/rust#26406 - [x] ~~rust-lang/rust#24622~~ - [x] ~~rust-lang/rust#23442~~ - [x] ~~rust-lang/rust#21748~~ - [x] ~~rust-lang/rust#25692~~ - [x] ~~rust-lang/rust#21953~~ - [x] ~~rust-lang/rust#27592~~ - [ ] Just take implied | labels: A-type-system, B-RFC-approved, T-lang, T-compiler, C-tracking-issue, S-tracking-needs-summary", "label": "critical_bug", "label_id": 0} {"id": "rust_27580", "text": "Leading plus for string to integer parsing | The `parse::()` function (and all its cousins for other integer types) fail for strings starting with a `+` with `ParseIntError { kind: InvalidDigit }`. Failing snippet: ``` fn main () { assert_eq!(\"+42\".parse::().unwrap(), 42); } ``` The same error occurs with the symm | labels: P-low, I-needs-decision, T-libs-api", "label": "question", "label_id": 4} {"id": "rust_27581", "text": "Redundant mut checking does not work for lazily initialized variables | The following piece of code contains a redundant `mut`, but triggers no warning: ``` rust fn main() { let mut a; a = 13; println!(\"{}\", a); } ```", "label": "medium", "label_id": 2} {"id": "rust_27583", "text": "Apparent regression in implied bounds | In the RFC 1214 branch, I found that at some point after a rebase (where a new snapshot was introduced), a new implied bound was needed. I believe this is specific to stage0, but I am not sure. I didn't have time to minimize or dig deeply, so i've marked the offending bound for n | labels: A-type-system", "label": "high", "label_id": 1} {"id": "rust_27585", "text": "Tracking issue for `read_exact` (RFC #980) | https://github.com/rust-lang/rfcs/pull/980 | labels: B-RFC-approved, T-libs-api, final-comment-period", "label": "medium", "label_id": 2} {"id": "rust_27587", "text": "The Rust Reference - no mention of #[cfg(target_env)]. | Title says it all. cc @steveklabnik", "label": "medium", "label_id": 2} {"id": "rust_27589", "text": "Docs: & in colored method signatures not rendered correctly on chrome in windows 10 | When rendering [the documentation to any standard library class](https://doc.rust-lang.org/std/collections/struct.LinkedList.html) with Chrome Version 44.0.2403.130 m (64-bit) - the latest release on Windows 10, the & character is obviously not rendered correctly, as demonstrated | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_27590", "text": "v1.2.0 error when building rustc for ios targets | Cannot seem to get the same targets to compile on v1.2.0, with the same commands used for v1.1.0 ``` bash git clone git@github.com:rust-lang/rust.git cd rust git checkout 1.2.0 ./configure --target=armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,aarch64-apple-ios,x86_64-apple-ios", "label": "question", "label_id": 4} {"id": "rust_27591", "text": "[Nightly 1.4.0-4f33e43cb 2015-08-05] Compiler panic when mis-using Zero trait | Attempting to misuse a trait can cause a compiler panic. The offending code is a simplified version of what I was working on. I tried this code: ``` fn rem_is_zero(n: T, m: T) -> bool where ::Output: Zero + Eq { let z = ::Output::zero(); // | labels: I-ICE, regression-from-stable-to-nightly", "label": "critical_bug", "label_id": 0} {"id": "rust_27592", "text": "format_args! returned from a closure causes corruption/crash | The following code causes an abort in the generated executable, due to a bad jump in `::std::fmt::write` (indirect call to 0x1) This is present on stable, beta, and nightly, both with and without optimisation on. (from my tests in playpen) ``` rust fn write<'a, F: ::std::ops::FnO | labels: A-type-system", "label": "high", "label_id": 1} {"id": "rust_27593", "text": "Error message for mutating field of immutable struct could be clearer | ``` rust struct Foo { pub v: Vec } fn main() { let f = Foo { v: Vec::new() }; f.v.push(\"cat\".to_string()); } ``` The above code gives this compile error: ``` rust :8:5: 8:8 error: cannot borrow immutable field `f.v` as mutable :8 f.v.push(\"cat\".to_string()); ^ | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27594", "text": "False negative comparing targets with equivalent paths | Imagine a directory structure such as: ``` ├── main.rs ├── target.json ├── libthing/ │ ├── lib.rs ``` Where `main.rs` depends on the separate crate `thing` ``` cd libthing/ && rustc lib.rs --target ../target.json rustc main.rs --target target.json --extern thing=libthing/libthing", "label": "medium", "label_id": 2} {"id": "rust_27597", "text": "broken links in nightly docs search result | Searching https://doc.rust-lang.org/nightly/std/ for something from the `collections` module (i.e. `into_boxed_slice` produces links to the documentation of `core_collections::...` as well as `collection::...`, where the `core_collections::...` entries are listed first and more i | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_27598", "text": "std implementation of panic might not detect double panicking | Implementation of `std::panicking::on_panic` may panic and not detect it is double-panicking, entering endless loop of panicking and overflowing stack.", "label": "medium", "label_id": 2} {"id": "rust_27599", "text": "Backport #27582 to beta | #27582 Needs to be back ported (I'm on a mobile device, and I forgot our protocol for nominating back ports. Just wanted to ensure this doesn't fall through the cracks.)", "label": "medium", "label_id": 2} {"id": "rust_27601", "text": "Shift operators: signed RHS, Wrapping impl | **1. Shift operators are defined for signed RHS types** The following fails to compile: `1u32 << -1i32`; this compiles: `let i = -1i32; 1u32 << i` but panics due to overflow in debug mode and evaluates to `0` or `2147483648` in release mode, depending on whether the `u32` value i", "label": "question", "label_id": 4} {"id": "rust_27602", "text": "thread 'rustc' panicked at 'assertion failed: index.end <= self.len()', ../src/libcore/slice.rs:544 | $ rustc --version rustc 1.2.0 (082e47636 2015-08-03) $ RUST_BACKTRACE=1 cargo build 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/master/CONT", "label": "high", "label_id": 1} {"id": "rust_27604", "text": "Confusing error message when using arithmetic operators on different number types | ``` rust fn main() { let x : f32 = 1.0; let y = x / 10; //error: the trait `core::ops::Div<_>` is not implemented for the type `f32` } ``` The error message is confusing because it reads as though you cannot divide `f32`s at all when the real issue is that you can't divide a `f32 | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27606", "text": "When are we getting the \"more general mechanism\" for struct inheritance | Aka virtual structs, [this](https://github.com/rust-lang/rfcs/blob/master/text/0341-remove-virtual-structs.md), although relatively old, said that there might be a general mechanism in the future. When is the future and what is the general mechanism?", "label": "medium", "label_id": 2} {"id": "rust_27607", "text": "Rustdoc should display the `since` version for stable items | You can't tell when something like `FromRawFd` was stabilized without going into the source: https://doc.rust-lang.org/stable/std/os/unix/io/trait.FromRawFd.html | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27608", "text": "Wrong \"Private type in exported type signature\" error | Consider this code: ``` rust mod a { pub mod x { pub fn return_x() -> ::X { ::X } } } struct X; fn main() { let _value = a::x::return_x(); } ``` It fails to compile with the following error: ``` test.rs:3:30: 3:33 error: private type in exported type signature test.rs:3 pub fn re", "label": "medium", "label_id": 2} {"id": "rust_27610", "text": "std::sync::Once has way more barriers than necessary | I believe that (comments removed) ``` rust pub fn call_once(&'static self, f: F) where F: FnOnce() { if self.cnt.load(Ordering::Acquire) < 0 { return } let prev = self.cnt.fetch_add(1, Ordering::Acquire); if prev < 0 { self.cnt.store(isize::MIN, Ordering::Release); return } le | labels: I-slow, C-enhancement, T-libs-api", "label": "low", "label_id": 3} {"id": "rust_27614", "text": "Borrow checker overly conservative when assigning to a parent reference | Consider the following simplified testcase. This is some Rust translation of the C idiom `while ((p = p->next))`. ``` struct List { next: Option> } fn bar(p: &mut List) { let n = match (*p).next { Some (ref mut q) => &mut **q, None => p }; bar(n); } ``` The code compile", "label": "medium", "label_id": 2} {"id": "rust_27616", "text": "borrowck is unsound in the presence of `&'static mut`s | ## STR ``` Rust use std::mem; fn leak(mut b: Box) -> &'static mut T { // isn't this supposed to be safe? let inner = &mut *b as *mut _; mem::forget(b); unsafe { &mut *inner } } fn evil(mut s: &'static mut String) { // create alias let alias: &'static mut String = s; let inn | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_27619", "text": "Intermittent with backtrace-debuginfo.rs | http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/6036/steps/test/logs/stdio from https://github.com/rust-lang/rust/pull/27617 ``` failures: ---- [run-pass] run-pass/backtrace-debuginfo.rs stdout ---- error: test run failed! status: exit code: 101 command: i686-unkn", "label": "medium", "label_id": 2} {"id": "rust_27620", "text": "btree: Reliance on structure layout | The function `collections::btree::node::Node::as_slices_internal_mut` relies on structure layout of two relatively unrelated structures to be the same, which is considered a bad thing™: ``` #[inline] pub fn as_slices_internal_mut<'b>(&'b mut self) -> MutNodeSlice<'b, K, V> { unsa", "label": "medium", "label_id": 2} {"id": "rust_27621", "text": "configure should make sure that LLVM FileCheck exists | Trying to package rust 1.2 into Debian & Ubuntu, I get the following test failures: ``` running 4 tests test [codegen] codegen/coercions.rs ... FAILED test [codegen] codegen/stores.rs ... FAILED test [codegen] codegen/loads.rs ... FAILED test [codegen] codegen/function-arguments.", "label": "medium", "label_id": 2} {"id": "rust_27623", "text": "TcpStream fails to connect on pre-resolved socket address. | I tried this code: ``` rust use std::net::{TcpStream, ToSocketAddrs}; fn main() { // all good let mut stream = TcpStream::connect(\"google.ca:80\").unwrap(); // resolving the address works let addr = \"google.ca:80\".to_socket_addrs() .unwrap() // unwrap re", "label": "medium", "label_id": 2} {"id": "rust_27626", "text": "extern crate foo with use self::foo doesn't work inside a function | EDIT (@steveklabnik) see https://github.com/rust-lang/rust/issues/27626#issuecomment-263955318 This code fails and rustc doesn't tell you why: ``` rust fn main() { extern crate rand; use self::rand::Rng; } ``` ([playpen](http://is.gd/xYyadr)) I think it should at least warn, assu | labels: C-enhancement, A-diagnostics, A-resolve", "label": "low", "label_id": 3} {"id": "rust_27627", "text": "Investigate dynamic Vec growth strategy for jemalloc hugs | Facebook's alternative C++ STL uses a rather dynamic strategy to ostensibly be friendly for common workloads and jemalloc's size classes. While most of FBVector's stuff is hacking around the fact the move/copy constructors are Awful, this seems applicable to us. See: - https://gi | labels: I-slow, C-enhancement, A-collections, T-libs-api", "label": "low", "label_id": 3} {"id": "rust_27628", "text": "loads.rs & stores.rs tests are failing with LLVM 3.6.1 | ``` ---- [codegen] codegen/stores.rs stdout ---- error: verification with 'FileCheck' failed status: exit code: 1 command: /usr/lib/llvm-3.6/bin/FileCheck -input-file=x86_64-unknown-linux-gnu/test/codegen/stores.ll /home/sylvestre/dev/debian/rustc.git/src/test/codegen/stores.rs s | labels: A-LLVM", "label": "medium", "label_id": 2} {"id": "rust_27629", "text": "Float expressions confusing with trait method calls | ``` fn main() { // Both asserts give: // 'assertion failed: `(left == right)` (left: `-2`, right: `-3`)' assert_eq!( -2.4_f32.floor(), (-2.4_f32).floor() ); assert_eq!( -2.4_f64.floor(), (-2.4_f64).floor() ); } ``` rustc 1.2.0 (082e47636 2015-08-03) binary: rustc commit-hash: 082", "label": "medium", "label_id": 2} {"id": "rust_27631", "text": "index out of range unexpected panic | I tried this code (my little follow up learning rust and ogl) ``` #[macro_use] extern crate glium; extern crate num; extern crate image; extern crate nalgebra; use std::io::Cursor; fn main() { use glium::{DisplayBuild, Surface}; use nalgebra::*; use num::traits::Float; let displa | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27632", "text": "Add \"How to build documentation\" section. | It'd be helpful for people who want make documentation pull requests that aren't just typo's to be able to build the documentation, and preview it themselves. Adding a \"How To\" about how documentation for the main repo should be built, would be helpful.", "label": "medium", "label_id": 2} {"id": "rust_27637", "text": "Improve documentation of std.io.ErrorKind variants | On the [std.io.ErrorKind](http://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html) documentation page, there's a list of error kinds along with descriptions of what the kinds mean. I personally got confused by what the _new_ variant `InvalidData` actually means from that desc | labels: E-easy", "label": "low", "label_id": 3} {"id": "rust_27639", "text": "Rust 'const iter' results in 'for'-errors | having the following code ``` rust fn main() { const iter: i32 = 5; for i in 0..10 { println!(\"{}\", i); } } ``` produces the following error: ``` rust src/main.rs:4:5: 6:6 error: type mismatch resolving ` as core::iter::IntoIterator>::IntoIter == i32`: expected struct `core::ops: | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_27640", "text": "Exporting a function as main does not work as expected | ``` mod foo { pub fn bar() { } } pub use foo::bar as main; ``` does not compile due to ``` error: main function not found aborting due to previous error ``` The expected behaviour would be that the compiler treats the global symbol `main` which resolves to `foo::bar` as the main ", "label": "medium", "label_id": 2} {"id": "rust_27645", "text": "ERROR:rbml::reader: failed to find block with tag 258 while compiling 1.2 for arm-unknown-linux-gnueabi | While compiling rust 1.2.0 on a Ubuntu 15.04 virtualbox VM for arm-unknown-linux-gnueabi, I ran into a panic compiling src/librbml/libs.rs at line [395](https://github.com/rust-lang/rust/blob/master/src/librbml/lib.rs#L395). My configuration and build commands: ``` ./configure -- | labels: I-ICE, A-metadata", "label": "high", "label_id": 1} {"id": "rust_27646", "text": "x86 MSVC does not use SSE(2) | @cmr noticed this on IRC. [On `i686-pc-windows-gnu`](https://github.com/rust-lang/rust/blob/master/src/librustc_back/target/i686_pc_windows_gnu.rs) and in fact on all other `i686-*` triples (except iOS, which is technically called `i386-*`), a SSE2-capable microarchitecture is as", "label": "medium", "label_id": 2} {"id": "rust_27654", "text": "Note message after error recommends using inaccessible private fields. | The following code: ``` rust pub mod animal { pub struct Dog { pub age: usize, dog_age: usize, } impl Dog { pub fn new(age: usize) -> Dog { Dog { age: age, dog_age: age * 7 } } } } fn main() { let dog = animal::Dog::new(3); let dog_age = dog.dog_age(); //let dog_age = dog.dog_age", "label": "medium", "label_id": 2} {"id": "rust_27656", "text": "Confusing move behavior | ``` rust struct Foo { bar: u32, } fn main() { let mut foo = Foo { bar: 10 }; let foo2 = foo; // <-- moved here foo.bar = 20; // <-- but still works! println!(\"{}\", foo.bar); // <- failed because `foo` has been moved } ```", "label": "medium", "label_id": 2} {"id": "rust_27660", "text": "\"Expected operator, found `/`\" when passing operator to macro | ``` rust macro_rules! apply_op { ( $op:tt ) => {{ 4 $op 5 }}; } fn main() { let _ = apply_op!(/); } ``` gives: ``` :2:24: 2:27 error: expected one of `.`, `;`, `}`, or an operator, found `/` :2 ( $op:tt ) => {{ 4 $op 5 }}; ^~~ ``` The same thing happens for other oper | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27661", "text": "string interpolation | things like: ``` rust let name = \"Anton\".to_string(); print!(\"hello {}\",name); ``` are very akward and verbose. What about scala-like string interpolation? ``` rust let name = \"Anton\".to_string(); print!(s\"hello $name\"); // s is put before string to tell that it is a string inter", "label": "medium", "label_id": 2} {"id": "rust_27667", "text": "Feedback on Rust Vec documentation from a beginner | Was: https://github.com/rust-lang/rust-www/issues/89, from @gnzlbg, submitted January 19th 2015. --- Hi, I just tried rust for the first time. From the description of the language, I decided to try a dynamic array first, since in my head this is the most important data structure ", "label": "low", "label_id": 3} {"id": "rust_27669", "text": "\"source trait is private\" error with `writeln!` only when `println!` isn't used | This error is related to https://github.com/rust-lang/rust/issues/22050, not sure if it's a dupe. Some of the following code snippets rely on the [term](https://crates.io/crates/term) library (but the issue seems to be in Rust, not `term`). The following builds fine: ``` rust fn | labels: E-easy, E-needs-test", "label": "low", "label_id": 3} {"id": "rust_27671", "text": "try!() on iterator element cause compiler crash | When using the try!() macro, directly on an iterator element. The compiler crashes, and fails to tell what is wrong with the code. I tried this code: ``` rust for try!(element) in elements { // Do stuff here } ``` Cargo crashed when attempting to compile the code. Commenting that | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27673", "text": "Write::write_fmt causes page fault on a bare metal | My experimental code crashes when running on bare x86_64-metal (page fault when IDT is not yet set), but works perfectly on aarch64. By careful tracing I figured out that the cause of this page fault consists of corrupted address (much higher than 0x200_000, while only the first ", "label": "medium", "label_id": 2} {"id": "rust_27675", "text": "object-safe traits can have associated types with unchecked bounds | ## STR ``` Rust trait Foo { type Assoc: PartialEq>; } impl Foo for u32 { type Assoc = Box; } fn foo(u: Box, v: T::Assoc) -> bool { &v == &u } fn main() { let bar: Box>> = Box::new(4); foo(bar, Box::new(5)); } ``` ### Result ``` | labels: A-type-system, I-ICE, A-trait-system, P-high, T-compiler, I-unsound", "label": "critical_bug", "label_id": 0} {"id": "rust_27681", "text": "Update installing-rust.md with the newer release response | Currently, when issuing rustc --version, it provides the updated version; namely, rustc 1.2.0 (082e47636 2015-08-03). Update the docs to reflect this.", "label": "low", "label_id": 3} {"id": "rust_27683", "text": "Strange compile error | My Code is: ``` rust use std::collections::HashMap; use std::path; use std::fs; use std::error::Error; use std::io::{BufReader, BufRead}; use std::ops::Deref; fn read_code_file() -> HashMap { let mut airport_codes = HashMap::new(); let path = path::Path::new(\"Airp", "label": "medium", "label_id": 2} {"id": "rust_27685", "text": "`rustdoc` panics on unicode character inside code-block | `rustdoc` panics on HORIZONTAL ELLIPSIS inside a code-block ... `````` /// ``` /// All those things … /// ``` `````` ... while it accepts them otherwise : ``` /// /// All those things … /// /// > All those things … /// /// ### All those things … /// /// `All those things …` /// `", "label": "medium", "label_id": 2} {"id": "rust_27686", "text": "`--extern` broken for indirect dependencies | alpha.rs ``` rust pub struct Test; ``` beta.rs: ``` rust extern crate alpha; pub use alpha::Test; ``` gamma.rs ``` rust extern crate beta; pub use beta::Test; ``` Now, run the following ``` mkdir -p bin rustc alpha.rs -o bin/libalpha.rlib --crate-type lib rustc beta.rs -o bin/lib", "label": "medium", "label_id": 2} {"id": "rust_27692", "text": "need more coercions for composed iterator types that have Fns | Rust's problems with returning the complicated types that result from iterator composition are well-known. - See e.g. https://github.com/rust-lang/rfcs/pull/105 - (with possible follow-on tracking at https://github.com/rust-lang/rfcs/issues/518 , though most of the conversation s | labels: A-type-system, C-enhancement, A-inference", "label": "low", "label_id": 3} {"id": "rust_27695", "text": "Unresolved import error on struct vs unite-like struct | ``` rust pub use m::A; mod m { use super::*; pub struct A; //pub struct A { // a: bool //} } ``` The code compile with first definition of A, but not the second. This may be related to #26873.", "label": "medium", "label_id": 2} {"id": "rust_27697", "text": "Adding Deref impl affects lifetime bounds of other methods | From https://users.rust-lang.org/t/does-implementing-deref-affect-the-lifetime-bounds-of-all-other-methods/ --- Code: ~~http://is.gd/AkyE699~~ http://is.gd/AkyE69 If the Deref is removed, the code compiles. Presumably, the inclusion of the Deref implementation on the trait object | labels: A-type-system, A-lifetimes, E-needs-test, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27700", "text": "Tracking issue for allocation APIs | ## Current status Final incarnation of `std::heap` is being proposed in https://github.com/rust-lang/rfcs/pull/1974, hopefully for stabilization thereafter. Open questions for stabilization are: * Is it required to deallocate with the *exact* size that you allocate with? With the | labels: T-libs-api, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27701", "text": "Tracking issue for libcore + no_std stabilization | This issue is intended to represent the outstanding issues for stabilizing libcore and allowing its usage on stable Rust. There are a number of features currently associated with libcore: - `core` - `core_char_ext` - `core_prelude` - `core_slice_ext` - `core_str_ext` (note that ` | labels: T-lang, T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27702", "text": "Tracking issue for f32/f64 support in libcore | This issue is largely targeted at tracking the state of `core_float` in libcore, but it raises the question of how much floating point support should be in libcore. Right now we don't explicitly depend on many external functions, but a number of functions are exposed as bindings | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27703", "text": "Tracking issue for stabilizing randomness | Long ago we had `std::rand` and nowadays we have `extern crate rand`. This is such core functionality it likely wants to move back into the standard library at some point, and in the meantime this issue serves as a tracking issue for the `rand` feature in the standard library. Th | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27704", "text": "Tracking issue for OsStr conversions | This is a tracking issue for stabilizing the `convert` feature in the standard library, which is primarily associated with converting `OsStr` and `OsString` to byte or string types. Due to the length of discussions on #27390 and #27657 this will likely required an RFC to move for | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27705", "text": "Tracking issue for DNS in std::net | This is a tracking issue for the `lookup_addr` and `lookup_host` unstable features in the standard library. These are currently the only exposed support for DNS as a public interface. Functions like `TcpStream::connect` already expose the ability to resolve names via passing a st | labels: T-libs-api, final-comment-period, B-unstable, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_27706", "text": "Tracking issue for std::fs::canonicalize | This is a tracking issue for the unstable `fs_canonicalize` feature in the standard library. There are a number of reasons it is not currently stable: - The implementation on Unix isn't technically memory safe. - The implementation on Windows returns some quite odd paths which ar | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27707", "text": "Tracking issue for fs::walk_dir | This is a tracking issue for the `fs_walk` unstable feature in the standard library. Some of the open questions currently are: - There are many many ways to walk a directory, and there probably wants to be something like a `WalkBuilder` structure. - The current walking strategy h | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27708", "text": "Tracking issue for `as_unsafe_cell` stabilization | The `Cell::as_unsafe_cell` and `RefCell::as_unsafe_cell` methods return a reference to the underlying `UnsafeCell` in both cases. It's not clear what the use cases are for these methods and whether they can be achieved in some alternative way. If you are using these methods, plea | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27710", "text": "Tracking issue for fs::DirBuilder | This is a tracking issue for the unstable `dir_builder` feature in the standard library. The current purpose of this is to provide access to platform-specific options such as modes on Unix or security attributes on Windows. The current `create_dir` and `create_dir_all` APIs are b | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27711", "text": "Tracking issue for `drain` stabilization | The `drain` method was originally proposed in [collections reform 2](https://github.com/rust-lang/rfcs/pull/509) and then adjusted in a [follow-up RFC](https://github.com/rust-lang/rfcs/pull/574). The main remaining question for the API is the traits it uses to accept various kin | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27712", "text": "Tracking issue for `fs_mode` stabilization | The `fs_mode` feature refers to platform-specific constants for file access modes exported in `std::os`. While these constants are OK as-is, we don't have a clear overall vision for which constants should be included in `std::os` or how they should be organized. Before we stabili | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27713", "text": "Tracking issue for custom hashers in HashMap | This is a tracking issue for the unstable `hashmap_hasher` feature in the standard library. This provides the ability to create a HashMap with a custom hashing implementation that abides by the `HashState` trait. This has already been used quite a bit in the compiler itself as we | labels: A-collections, T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27714", "text": "Tracking issue for `str_utf16` stabilization | The `str_utf16` feature tracks APIs like `str::utf16_units` that support utf16 encoding. These APIs are working well today, but it would be good to have a clear picture of the final state of APIs we'd like to have for various string encodings in `std`, and how that relates to oth | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27715", "text": "Tracking issue for Scoped TLS | This is a tracking issue for the unstable `scoped_tls` feature in the standard library. The known open questions about this API are: - Is it useful enough to be stabilized? It doesn't look like there's been much usage yet. - Currently the API only accepts sized type parameters, b | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27716", "text": "Tracking issue for `thread_local_state` stabilization | This feature allows you to query a thread-local variable for its state: http://static.rust-lang.org/doc/master/std/thread/enum.LocalKeyState.html, which will then tell you what may happen if you try to read from the variable. The functionality is somewhat niche, but occasionally | labels: T-libs-api, final-comment-period, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27717", "text": "Tracking issue for static synchronization primitives | This is a tracking issue for the unstable `static_mutex`, `static_condvar`, and `static_rwlock` features in the standard library. Each of these represents a separate `StaticFoo` type (next to the type `Foo`) to provide a synchronization primitive that can be constructed in a stat | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27718", "text": "Tracking issue for `Rc`/`Arc` stabilization | There are a number of unstable features related to `Rc` and `Arc`, including both weak references and uniqueness. An [RFC to remove weak pointers](https://github.com/rust-lang/rfcs/pull/1232) failed, and the current consensus seems to be to stabilize these APIs after nailing down | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27719", "text": "Tracking issue for `recover` stabilization | The `recover` function is able, on a single thread, to recover from a panic. There are numerous controversies around this API, including the bounds it applies to its closure, its safety, and its location within `std`. An [open RFC](https://github.com/rust-lang/rfcs/pull/1236) see | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27720", "text": "Tracking issue for OpenOptionsExt on Windows | This is a tracking issue for the unstable `open_options_ext` feature in the standard library. Currently Unix has a stable extension trait for setting the mode of a file but Windows has not stabilized any of its functionality. The current set of methods on the Windows extension tr | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27722", "text": "Tracking issue for `path_prefix` stabilization | The `Path::prefix` method allows you to extract a `Prefix` from a path, if any -- which is relevant only on Windows, where the prefix gives e.g. volume information. It's already possible to get this information through the `components` iterator, so it's not clear whether this add | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27724", "text": "Tracking issue for {min,max} on iterators | This is a tracking issue for the unstable `iter_cmp` feature in the standard library. This is the ability to get the min or max elements out of an iterator via a custom closure for comparisons. Some open questions are: - Is `_by` the right suffix here? The stable `<[T]>::sort_by` | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27725", "text": "Tracking issue for `path_ext` stabilization | The `PathExt` trait provides a number of methods on paths that conveniently connect it to the `std::fs` API. While these methods are largely fine, there is some question as to how many of them there should be; the rationale for the exact selection of methods is currently a bit mu | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27726", "text": "Tracking issue for access to Formatter alignment | Tracking issue for the `fmt_flags_align` feature, which is [`fmt::Formatter::align`](https://doc.rust-lang.org/nightly/std/fmt/struct.Formatter.html#method.align) and the associated enum. | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "medium", "label_id": 2} {"id": "rust_27727", "text": "Tracking issue for `path_components_peek` stabilization | The `path::Components::peek` method allows you to peek at the next component in the iterator without actually consuming it. There's no strong reason for it to remain unstable, except that the conventions around such methods are a bit unclear. | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27728", "text": "Tracking issue for formatting with a radix | This is a tracking issue for the unstable `fmt_radix` feature in the standard library. These functions provide the ability to format a number in an arbitrary radix. Note that base 2, 8, and 10, and 16 are already supported via various formatting flags. Needs a decision about whet | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27729", "text": "Tracking issue for `as_slice` stabilization | Over time, the way that you convert e.g. a vector to a slice has transformed repeatedly. With deref coercions, it's usually implicit, but there are still some cases where you need to do it explicitly. The `as_slice` method follows the usual conversion conventions, but has been so | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27730", "text": "Tracking issue for `NonZero`/`Unique`/`Shared` stabilization | We currently have three internal types, `NonZero`, `Unique` and `Shared`, that are very useful when working with unsafe Rust code. Ultimately, the hope is to have a clear vision for semi-high-level, but unsafe programming using types like these. None of the current APIs have gone | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27731", "text": "Tracking issue for SIMD support | This is a tracking issue for the unstable `core_simd` feature in the standard library. SIMD support is quite a thorny topic, but it's largely covered in https://github.com/rust-lang/rfcs/pull/1199, being implemented in https://github.com/rust-lang/rust/pull/27169, and @huonw will | labels: T-libs-api, B-unstable, A-SIMD, C-tracking-issue, Libs-Tracked, A-target-feature", "label": "question", "label_id": 4} {"id": "rust_27732", "text": "Tracking issue for DST coercions (coerce_unsized, unsize) stabilization | [DST coercions](https://github.com/rust-lang/rfcs/pull/982) were the last part of DST to land, and are still undergoing [some changes](https://github.com/rust-lang/rfcs/pull/1234). Before stabilization, at the very least the API surface here needs some scrutiny from the libs team | labels: A-DSTs, T-lang, T-libs-api, B-unstable, B-RFC-implemented, C-tracking-issue", "label": "critical_bug", "label_id": 0} {"id": "rust_27733", "text": "Tracking issue for `borrow_state` stabilization | The `RefCell` API offers a way to determine the state of the borrow, to avoid panics on additional borrowing. It's not clear how useful this API is in practice, but it's otherwise ready for stabilization. ----- **EDIT:** @KodrAus Before stabilization: - [ ] Add a concrete, motiva | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27734", "text": "Tracking issue for concrete errors in the standard library | This is a tracking issue for the unstable `str_parse_error` and `utf8_error` features in the standard library. Some various small error types popped up once `FromStr` had an associated error type and haven't been considered too closely for stabilization. Some thoughts are: - Are | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27735", "text": "Tracking issue for `IntoCow` stabilization | **NOTE**: `IntoCow` has been deprecated, but you can get the same conversion by using the `Cow::Owned` constructor, like so: `Cow::Owned(vec![1, 2, 3])`. # The `IntoCow` trait is a custom conversion trait for working with `Cow`; the custom nature is needed to deal with trait cohe | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27736", "text": "Tracking issue for f{32,64}::from_str_radix | This is a tracking issue for the unstable `float_from_str_radix` feature in the standard library. These functions I believe were added to mirror the functionality on integers, but it's unclear what these functions are actually doing in terms of radixes. There's also a [discussion | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27737", "text": "Tracking issue for `iter_order` stabilization | The `iter` module has an `order` submodule for performing comparisons on iterators. Ideally, these would instead just be implementations of e.g. the `PartialOrd` trait, but that trait passes by shared reference, and iterators must be mutated to be compared. It'd be good to explor | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27738", "text": "Tracking issue for reentrant mutexes | This is a tracking issue for the unstable `reentrant_mutex` feature in the standard library. Currently this flavor of mutex is not exposed at all in the standard library (it's private in the `sys`module), but it's an often-useful form of a mutex. We should decide whether or not t | labels: T-libs-api, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27739", "text": "Tracking issue for `Zero`/`One`/`iter_arith` stabilization | We currently have `Zero` and `One` traits that are meant to work with `Add` and `Mul` and support iterator operations like `sum`, as well as the current `step_by` API. It would be good to have a more comprehensive vision for this kind of trait before stabilization; an RFC would b | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27740", "text": "Tracking issue for std::slice::bytes | This is a tracking issue for the unstable `slice_bytes` feature in the standard library. This module has some various helper methods for dealing with blocks of bytes in an efficient fashion, but they seem particularly one-off and not necessarily fitting in with the rest of the de | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27741", "text": "Tracking issue for `step_by` stabilization | Update (@SimonSapin): this is now the tracking issue for an iterator adaptor based on `Iterator::nth`: ```rust pub trait Iterator { fn step_by(self, step: usize) -> StepBy } ``` The `Step` trait used for making ranges iterators is now tracked at https://github.com/rust-lang | labels: P-medium, E-mentor, T-libs-api, B-unstable, E-help-wanted, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27742", "text": "Tracking issue for slice_splits | This is a tracking issue for the unstable `slice_splits` feature in the standard library. These functions were added in [RFC 1058](https://github.com/rust-lang/rfcs/pull/1058) and implemented in https://github.com/rust-lang/rust/pull/26966. These probably just need to bake for aw | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27743", "text": "Tracking issue for str::match_indices | This is a tracking issue for the unstable `str_match_indices` feature in the standard library. This function should largely be good to go except for the note indicating that the returned iterator should probably yield different types of values to stay consistent with other method | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27744", "text": "Tracking issue for `push_all` stabilization | The `Vec::push_all` method special-cases pushing a slice onto a vector, and historically has performed much better than using `extend` (depending on how LLVM optimizations are working out). We need to offer a method with maximal performance somehow, but ideally this would come fr | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27745", "text": "Tracking issue for type_id stabilization | The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "question", "label_id": 4} {"id": "rust_27746", "text": "Tracking issue for `cell_extras` stabilization | The `Ref` type connected to `RefCell` supports some methods for changing the type of the reference, such as `map` and `filter_map`. While `map` is clearly fully general, `filter_map` is somewhat of a special case hooked into `Option`. To make it fully general would likely require | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27747", "text": "Tracking issue for `slice_concat_ext` stabilization | The [SliceConcatExt](http://static.rust-lang.org/doc/master/std/slice/trait.SliceConcatExt.html) trait offers methods `concat` and `join` on slices. For somewhat technical reasons, it wasn't possible to make these inherent methods. The methods themselves are stable, but the trait | labels: T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close, A-slice", "label": "medium", "label_id": 2} {"id": "rust_27748", "text": "Tracking issue for `wait_timeout_with` stabilization | The [`wait_timeout_with` method](http://static.rust-lang.org/doc/master/std/sync/struct.Condvar.html#method.wait_timeout_with) allows you to wait on a `CondVar` with a particular timeout, but also to cancel waiting based on a closure you pass in. It's not clear if this API is bro | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27749", "text": "Tracking issue for `Reflect` stabilization | The `Reflect` trait is currently unstable. It was intended to narrow the use of things like `Any` for runtime introspection, to help retain parametricity properties. However, with [impl specialization](https://github.com/rust-lang/rfcs/pull/1210) these properties would go away an | labels: T-lang, T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27750", "text": "Tracking issue for `clone_from_slice` stabilization | The `clone_from_slice` method clones a slice into another, using the `clone_from` method, which in principle can be more efficient than using `clone`. It's not clear whether this method, or `clone_from`, are seeing any use at all. | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27751", "text": "Tracking issue for `raw` stabilization (`raw::TraitObject`) | The `std::raw` module exports some representation details for the purposes of transmuting and taking things apart. Stabilizing these means pinning down the representation details forever. One possibility is to instead provide various conversions, rather than asking people to use | labels: A-trait-system, T-lang, T-libs-api, B-unstable, C-tracking-issue, Libs-Tracked", "label": "question", "label_id": 4} {"id": "rust_27752", "text": "Tracking issue for `float_extras` stabilization | There are a number of floating point methods that are reexported from cmath, without a strong naming convention on the Rust side, or a clear rationale for which methods are included and which are not. Ideally, someone who works with floating point, and these methods in particular | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27753", "text": "Tracking issue for `num_bits_bytes` stabilization | The `BITS` and `BYTES` constants for e.g. `i32` are currently unstable, due to lack of clarity around: - Should these be associated constants of the type instead? - Is there a better way to get at these via e.g. `size_of`? cc @eddyb | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27754", "text": "Tracking issue for `str_char` stabilization | The `str` type offers a number of `char`-oriented methods, many of which can be replaced by uses of `char_indices`. It's not clear how widely used these methods are, or whether there are significant downsides over using `char_indices`. This API area needs a comprehensive re-evalu | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27755", "text": "Tracking issue for `wrapping` stabilization | The `std::num::wrapping` module provides a trait, `OverflowingOps`, that permits overflowing arithmetic on primitive types and tells whether an overflow occurred. Other methods, like `saturating_add` and `wrapping_add`, are included directly as inherent methods on these types. It | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27756", "text": "Mistaken warning when working around `E0386` restrictions regarding mutable references in immutable containers. | While writing the detailed diagnostics for `E0386` (cannot assign to data in an immutable container, #24407), I came across a possible mistaken warning. `E0386` is about forbidding mutation of a mutable reference stored in an immutable container: ``` rust let mut x: i64 = 1; let ", "label": "medium", "label_id": 2} {"id": "rust_27759", "text": "rustdoc unstable should show feature name and issue | rustdoc currently shows unstable things like the following (for [`Result::expect`](http://doc.rust-lang.org/stable/std/result/enum.Result.html#method.expect)): > Unstable: newly introduced It could also include the name of the feature and a link to the tracking issue, e.g. > Unst | labels: E-easy, T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_27764", "text": "Tracking issue for CStr => str conversions | This is a tracking issue for the `cstr_to_str` unstable feature in the standard library. These methods are probably ready to just get stabilized as-is. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27765", "text": "Tracking issue for collection append methods | This is a tracking issue for the unstable `append` feature in the standard library. It's somewhat unclear if these methods _need_ to be stabilized, but it's also fairly clear that they're not going to change from their current form. They will likely go into FCP soon. cc @Gankro. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27766", "text": "Tracking issue for collection split_off methods | This is a tracking issue for the unstable `split_off` feature in the standard library. It's somewhat unclear if these methods need to be stabilized, but it's also fairly clear that they're not going to change from their current form. They will likely go into FCP soon. cc @Gankro. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27767", "text": "Tracking issue for VecDeque::retain | This is a tracking issue for the unstable `vec_deque_retain` feature in the standard library. This is probably ready to just be stabilized as-is. cc @Gankro | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27768", "text": "Tracking issue for Box::{into_raw, from_raw} | This is a tracking issue for the `box_raw` unstable feature in the standard library. These methods are functionally ready to go but may need to settle on some names. Other candidates (like those that `CString` chose) are `into_ptr` and `from_ptr`. These shouldn't be stabilized un | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27769", "text": "Tracking issue for CString::{from_ptr, into_ptr} | This is a tracking issue for the unstable `cstr_memory` feature in the standard library. These methods are likely ready to go as-is modulo naming. Their names should be consistent with `Box::{from_raw, into_raw}` (currently inconsistent). cc #27768 | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27770", "text": "Tracking issue for Result::expect | This is a tracking issue for the unstable `result_expect` feature in the standard library. This is likely ready to just be stabilized as-is | labels: T-libs-api, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27771", "text": "Tracking issue for some Duration-taking functions | This is a tracking issue for some small Duration-taking functions in the standard library, specifically the `park_timeout` and `thread_sleep` functions. Now that `Duration` is stabilized these are likely ready to be stable as-is. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27772", "text": "Tracking issue for Condvar::wait_timeout | This is a tracking issue for the unstable `wait_timeout` feature in the standard library. An open question here is whether the tuple return value with a `bool` is appropriate or whether an `enum` of some form should be returned instead. cc @sfackler | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27773", "text": "Tracking issue for the socket timeout functions | This is a tracking issue for the unstable `socket_timeout` feature in the standard library. Now that the `Duration` type is stable it may be the case that these methods can just be stabilized as-is. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27774", "text": "Tracking issue for slice::{ref_slice, mut_ref_slice} | This is a tracking issue for the unstable `ref_slice` feature in the standard library. These functions seem fairly innocuous but it's also somewhat questionable how useful they are. They're probably ready for either stabilization or deprecation as-is. cc @nikomatsakis | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27775", "text": "Tracking issue for converting slice iterators to slices | This is a tracking issue for the unstable `iter_to_slice` feature in the standard library. The `into_vec` adaptor for `vec::IntoIter` was recently removed, and these may also want to be removed. It's somewhat unclear how useful it is to have iterators enhanced with this kind of f | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27776", "text": "Tracking issue for viewing Result/Option as slices | This is a tracking issue for the unstable `as_slice` feature in the standard library. These functions enable viewing a `Result` and `Option` as some form of `[T]` (both shared and mutably). In each case an array of at most one item will be returned. It's somewhat unclear | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27777", "text": "Tracking issue for iter::range_inclusive | This is a tracking issue for the unstable `range_inclusive` feature in the standard library. This will likely be deprecated and removed if https://github.com/rust-lang/rfcs/pull/1192 is accepted. Otherwise this will likely be deprecated and removed in favor of a builder-style int | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27778", "text": "Tracking issue for FixedSizeArray trait | This is a tracking issue for the unstable `fixed_size_array` feature in the standard library. This is likely to be deprecated and removed in favor of generic integers one day, and in the meantime there are not many consumers of it. | labels: T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close, A-const-generics", "label": "medium", "label_id": 2} {"id": "rust_27779", "text": "Tracking issue for placement new | This is a tracking issue for the unstable `placement_new_protocol` feature in the standard library, and `placement_in_syntax`/`box_syntax` in the compiler. (@pnkfelix adds below:) Things to decide / finalize before stabilization: - [ ] placement-in syntax, e.g. `in PLACE { BLOCK | labels: B-RFC-approved, T-lang, T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27780", "text": "Tracking issue for <*mut T, *const T>::{as_ref, as_mut_ref} | This is a tracking issue for the unstable `ptr_as_ref` feature of the standard library. These functions allow unsafely converting raw pointers to optional safe references, returning `None` if they're null. I would personally vote for removing these, but there's certainly some usa | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27781", "text": "Tracking issue for char::from_u32_unchecked | This is a tracking issue for the unstable `char_from_unchecked` feature of the standard library. This API is relatively new and needs some time to bake, but it's likely to just be stabilized as-is. | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27782", "text": "Tracking issue for DebugTuple::formatter | This is a tracking issue for the unstable feature `debug_builder_formatter` in the standard library. This method was add relatively recently, and my thoughts on it are: - It seems odd to have this function only on `DebugTuple` and no other builders. - It does seem reasonable to a | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27783", "text": "Tracking issue for location of facade crates | We probably don't want to indefinitely have a large number of facade crates which are all unstable, so we should eventually stabilize these crates, fold them back into the standard library, or find a good middle ground in which they can all reside. The current set of crates consi | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27784", "text": "Tracking issue for char encoding methods | This is a tracking issue for the unstable `unicode` feature and the `char::encode_utf{8,16}` methods. The interfaces here are a little wonky but are done for performance. It's not clear whether these need to be exported or not or if there's a better method to do so through iterat | labels: T-libs-api, final-comment-period, B-unstable, E-help-wanted", "label": "medium", "label_id": 2} {"id": "rust_27785", "text": "Tracking issue for Box/String conversions | This is a tracking issue for the unstable `box_str` feature in the standard library. These functions were recently added and probably just need to bake for a bit, but other than that I believe they're ready for stabilization (modulo the naming in https://github.com/rust-lang/rust | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27787", "text": "Tracking issue for sorted collection ranges | This covers `btree_range` and `collections_bound`. Both try to address the combinatorics over inclusive/exclusive/none bounds on ordered queries. I am significantly unsatisfied with the current solution, which is `btree.range(Bound(&K), Bound(&K))`. This pushes all the combinator | labels: T-libs-api, final-comment-period, B-unstable, E-help-wanted", "label": "question", "label_id": 4} {"id": "rust_27788", "text": "Tracking issue for VecDeque Extras | This covers the `deque_extras` blanket feature, which should probably be sharded more in the future. It covers: - `truncate` - `resize` - `as_slices` - `as_mut_slices` - `swap_back_remove` - `swap_front_remove` Some notes: - `truncate` and `resize` are strange because they aren't | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27790", "text": "Tracking issue for Vec::resize | This is a tracking issue for the unstable `vec_resize` feature in the standard library. To the best of my knowledge there's no blocker for this beyond \"we should decide to have it or not\". cc @Gankro | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27791", "text": "Tracking issue for str escaping | This is a tracking issue for the unstable `str_escape` feature in the standard library. The open questions I know of here are: - Do we want to support these relatively arbitrary ways to escape strings? Note that these same methods for escaping characters are already stable. - Are | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "question", "label_id": 4} {"id": "rust_27792", "text": "Tracking issue for str::split_at | This is a tracking issue for the unstable `str_split_at` feature in the standard library. These are just mirrors of the slice `split_at` methods so I suspect that they will just be stabilized as-is. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27793", "text": "Tracking issue for str::slice_mut_unchecked | This is a tracking issue for the unstable `str_slice_mut` feature in the standard library. The major open question here is to what extent we want to support `&mut str` in the standard library. Currently the support is likely falling short in a number of `&str` vs `&mut str` metho | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27794", "text": "Tracking issue for extra linked list methods | This is a tracking issue for the unstable `linked_list_extras` methods in the standard library. cc @Gankro, perhaps you can fill this in some more? The specific methods in question are: - `IterMut::insert_next` - `IterMut::peek_next` | labels: B-RFC-approved, A-collections, T-libs-api, B-unstable, C-tracking-issue, Libs-Tracked", "label": "question", "label_id": 4} {"id": "rust_27795", "text": "Tracking issue for creating BTree{Map,Set} with a B | This is a tracking issue for the unstable `btree_b` feature in the standard library. cc @Gankro, perhaps you can fill in the details here? | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27796", "text": "Tracking issue for unix::FileTypeExt | This is a tracking issue for the unstable `file_type_ext` feature in the standard library. I think this is basically good to go, it'll likely expand over time but otherwise it's pretty self explanatory. | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27797", "text": "Tracking issue for consumption into OS handles | This is a tracking issue for the `into_raw_os` feature in the standard library which allows consuming I/O primitives to gain ownership of the underlying resource. I believe this is basically ready to be stabilized as-is. | labels: E-easy, T-libs-api, final-comment-period, B-unstable", "label": "low", "label_id": 3} {"id": "rust_27798", "text": "Tracking issue for sync::Semaphore | This is a tracking issue for the unstable `semaphore` feature of the standard library. - Should we have this kind of semaphore? - Should we allow negative counts? - Should there be an RAII guard for a \"resource\"? Decision! | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27799", "text": "Tracking issue for Duration::span | This is a tracking issue for the unstable `duration_span` feature of the standard library. Known open questions are: - Is this the right place for this API? - Is this the right name? - Should the closure be able to return a value? - Should various other system clocks be exposed? | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27800", "text": "Tracking issue for channel selection | This is a tracking issue for the unstable `mpsc_select` feature in the standard library. Known points: - The API is unsafe, and should probably never be stabilized. - Servo apparently makes very heavy use of this API, so it can't be removed without replacement currently. - The co | labels: T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close", "label": "medium", "label_id": 2} {"id": "rust_27801", "text": "Tracking issue for IpAddr | This is a tracking issue for the unstable `ip_addr` feature of the standard library. Some thoughts: - This isn't actually ever used in the system APIs as there's no notion of \"an IP address\", just an IPv4 or IPv6 address. - We have no stable APIs producing this value. - Some old | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27802", "text": "Tracking issue for Read::chars | This is a tracking issue for the deprecated [`std::io::Read::chars`](https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.chars) API. | labels: T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_27805", "text": "Missing snapshots for Bitrig, FreeBSD 32-bit and FreeBSD 64-bit | This issue is for adding the snapshots.", "label": "medium", "label_id": 2} {"id": "rust_27809", "text": "Tracking issue for make_ascii_{upper,lower}case | This is a tracking issue for the unstable `ascii` feature in the standard library. These functions have the somewhat odd naming scheme of `make_*` (not found elsewhere in the standard library). The utility with `&mut str` is also somewhat questionable as there's not a lot of supp | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27810", "text": "Tracking issue for std::dynamic_lib | This is a tracking issue for the unstable `dynamic_lib` feature of the standard library. This module should probably just be made private to the standard library and the compiler rather than being exported for now. A future RFC could decide whether it should be a module in the st | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27811", "text": "Tracking issue for CommandExt::session_leader | This is a tracking issue for the unstable `process_session_leader` feature in the standard library. Added in #26470 some open questions are: - Is there a Windows \"equivalent\" that should mean this is exposed on `Command` directly? - Is this the best name for the function? Should | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_27815", "text": "thread 'rustc' panicked at 'No def'n found for DefId | I was developing a new module for a small project: ``` rust //tests/command_parser_test.rs #[path=\"../src/command_parser.rs\"] mod command_parser; #[test] fn parses_non_sudo_without_args() { let cmd_str = \"ls\"; let cmd = command_parser::parse(cmd_str); assert_eq!(cmd.sudo, false); | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27817", "text": "Spans from serde losing expansion info | https://github.com/Manishearth/scratch/tree/rustc_serde_spans If you run `cargo build` in `poc` there, the `span_lint` shows: ``` Compiling poc v0.1.0 (file:///home/manishearth/sand/bar/poc) src/lib.rs:7:10: 7:19 error: this let-binding has unit value. src/lib.rs:7 #[derive(Seria | labels: A-diagnostics, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27819", "text": "'rustc' panicked at 'assertion failed: slice_layout_is_correct | _caveat_ This is my first bit of Rust and I don't know what I'm doing :wink: This is from the anagram exercism.io exercise. `rustc 1.2.0 (082e47636 2015-08-03)` ``` rust // src/lib.rs pub fn anagrams_for(input: String, inputs: &[str]) -> Vec<&str> { //vec![]; // either this line | labels: A-debuginfo, I-ICE", "label": "high", "label_id": 1} {"id": "rust_27820", "text": "macro_rules ICE with bare $crate | Playpen link: http://is.gd/Q53a7T", "label": "medium", "label_id": 2} {"id": "rust_27824", "text": "Floating point modulus has snuck back into the language | Back in https://github.com/rust-lang/rust/commit/1563ea9f278e1e1cd0d21fe8c4fc761805b71964 we decided to remove the `%` operator from floats in the language, relegating the implementations of the `Rem` trait to library calls on the `fmod` and `fmodf` functions. (some discussion in | labels: T-lang", "label": "question", "label_id": 4} {"id": "rust_27828", "text": "Type inference for closure gets confused without trivial help | The following falls over at the moment, but works with the commented version of the closure: ``` rust fn main() { let f = |&x| x as u64; // <-- doesn't work // let f = |&x: &_| x as u64; // <-- does work test_me0(&f); test_me1(&f); } fn test_me0 u64>(func: &F) -> u | labels: A-type-system, A-closures", "label": "medium", "label_id": 2} {"id": "rust_27829", "text": "ICE while declaring fixed-sized array depending on the item in the same struct | ``` rust struct Generic { pub size: u32, pub data: [u32; Generic::ckSize] } #[test] fn it_works() { } ``` Outputs: ``` error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github. | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27830", "text": "Tracking issue for UTF-16 decoding iterators | #27808 proposes exposing in `std::char` two iterator adaptors `Utf16Decoder` and `Utf16LossyDecoder`. This functionality was previously only available with an API that require allocation (`String::from_utf16{,_lossy}`) or using the unstable `rustc_unicode` crate directly. They ar | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27831", "text": "fieldless FRU can be used on non-struct-like structs | ## STR ``` Rust struct Foo(u32); fn main() { let x = Foo(42); let _ = Foo { ..x }; } ``` ## Result This compiles and runs. ## Expected This shouldn't compile.", "label": "medium", "label_id": 2} {"id": "rust_27832", "text": "Macro matchers only match when they feel like it | ...or at least that's how much I currently understand, since macros are really counterintuitive sometimes. ``` rust macro_rules! m { ( $i:ident ) => (); ( $t:tt $j:tt ) => (); } fn main() { m!(c); m!(t 9); // why does this work, but not the next case? m!(0 9); // ^ error: expecte | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_27840", "text": "Tracking issue for MIR (RFC #1211) | Tracking issue for transition to MIR (rust-lang/rfcs#1211). Relevant discuss thread: https://internals.rust-lang.org/t/transitioning-to-mir/2706 ### Regressions These are cases where building MIR is causing existing crates to stop working. - [x] https://github.com/rust-lang/rust/ | labels: B-RFC-approved, A-MIR", "label": "high", "label_id": 1} {"id": "rust_27842", "text": "Compiler message improvement | When trying to (erroneously) access members of a tuple using square brackets, rather than a period, the compiler gives the message \" error: cannot index a value of type .... \". Particularly as a new user, it would be nice if the compiler could suggest something like \"try using th | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27844", "text": "'rustc' panicked at 'assertion failed: `(left == right)` (left: `collections::string::String`, right: `Box`)', ../src/librustc_borrowck/borrowck/mod.rs:453 | Code to reproduce here: https://github.com/toffaletti/borrow-crash `rustc 1.2.0 (082e47636 2015-08-03)` ``` stack backtrace: 1: 0x103eb47b5 - sys::backtrace::write::hf5ea20500b66cd24uns 2: 0x103ebd013 - panicking::on_panic::hbe02cb0d925cad49iGw 3: 0x103e78dd2 - rt::unwind::begin_ | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27848", "text": "thread 'rustc' panicked at 'index out of bounds: the len is 60 but the index is 66', ../src/libcollections/vec.rs:1040 | the error reproduced https://github.com/rust-lang/rust/issues/20913 ``` #![feature(plugin)] #![plugin(regex_macros)] extern crate regex; static R : regex::Regex = regex!(r\".+\"); fn main() { println!(\"Hello, world!\"); } ``` Cargo.toml ``` [package] name = \"hello_world\" version = \" | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27852", "text": "Vec::reserve and Vec::reserve_exact examples should be differentiated | `Vec::reserve` and `Vec::reserve_exact` are two different methods that do slightly different things - https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.reserve - https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.reserve_exact Right now, both of their e", "label": "medium", "label_id": 2} {"id": "rust_27854", "text": "How to write a generic trait method returning value conforming to the trait? | I've spent several hours trying to get this to work, and no one on IRC seems to have any answers either. Basically, I have a generic trait that I want to apply to a couple different generic structs which should have a method that returns a new, different generic object based on t", "label": "medium", "label_id": 2} {"id": "rust_27859", "text": "f32 \"%\" is broken on MSVC | ``` rust fn main() { println!(\"{}\", 1.5f32 % std::env::args().len() as f32); } ``` This code doesn't link on MSVC targets. (Sorry if I messed up the testcase; I don't have a Rust install on Windows to test with.)", "label": "medium", "label_id": 2} {"id": "rust_27861", "text": "No single-call way to constant-time move elements in and out of a Vec for pair/triple/etc.-wise operations | This results in some annoying code bloat when trying to mutate two or more vector elements with respect to one another: ``` rust struct A { a: u8, b: u8 } impl A { pub fn do_stuff(&mut self, other: &mut Self) { self.a = other.a % self.b; other.b = self.b % other.a; } } fn main() ", "label": "medium", "label_id": 2} {"id": "rust_27862", "text": "Pipe character in rustdoc markdown tables can not be escaped | Attempting to use the pipe symbol in tables in doc-comments does not work as it will be interpreted as a table-separator even when attempting to escape it. Attempts to use html-entities also fails (ie. `|`) and they end up escaped. Example: ``` markdown Test | Table ------|- | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27863", "text": "Cannot impl Drop for a generic type with a Higher-Rank Trait Bound | If I try to compile this program: ``` rust pub trait Foo<'a> {} pub struct Bar where T: for<'a> Foo<'a> { _phantom: ::std::marker::PhantomData, } impl Drop for Bar where T: for<'a> Foo<'a> { fn drop(&mut self) {} } fn main() {} ``` I get this clearly bogus error mess | labels: A-type-system, A-trait-system, A-destructors, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_27865", "text": "Change `BTreeMap` to use parent pointers | This will require nodes to have a stable address. CC #26227 @Gankro.", "label": "medium", "label_id": 2} {"id": "rust_27868", "text": "Inconsistent evaluation order for assignment operations | UPDATE: This is fixed by the MIR-based borrow checker and just needs a test. [See the mentoring instructions below.](https://github.com/rust-lang/rust/issues/27868#issuecomment-378392425) --- Currently, the borrow checker thinks that the RHS of `+=` is evaluated before the LHS. t | labels: P-medium, E-mentor, A-borrow-checker, T-lang, I-unsound, A-NLL", "label": "critical_bug", "label_id": 0} {"id": "rust_27872", "text": "`syntax::ast::Expr_::ExprClosure` should have an Expr instead of Block | Currently closures of the form `|a| a * a` are very hard to pretty-print since `a * a` is wrapped in an `ast::Block`, even though there are no curly braces. Match arms contain general sub-expressions, as well. Is there any technical reason why they are treated differently? | labels: A-parser", "label": "medium", "label_id": 2} {"id": "rust_27873", "text": "ABIs are validated before cfg-ing | The ABI string for `extern \"...\"` is validated while being parsed, meaning one can get errors about in `cfg`'d off modules: ``` rust #[cfg(foo)] mod foo { extern \"foo\" {} } ``` ``` :3:12: 3:17 error: illegal ABI: expected one of [cdecl, stdcall, fastcall, aapcs, win64, Rust | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_27874", "text": "ICE on impossible trait object/associated type | `````` rust trait Hack: std::ops::Add + Copy {} fn takes_hack(x: &Hack) {}``` (which can't work of course) Gives: thread 'rustc' panicked at 'assertion failed: !ty.needs_infer()', ../src/librustc_typeck/lib.rs:152 on playpen's nightly and on an ol | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27876", "text": "rustdoc does not document the ... in varargs arguments | http://blackbeam.org/doc/libc/funcs/bsd44/fn.ioctl.html shows ioctl as taking two arguments. However, the underlying source at http://blackbeam.org/doc/src/libc/lib.rs.html#6084 shows ioctl as taking variable arguments (...) after those two. rustdoc should show that ... in the ar | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_27878", "text": "Segfault in je_rallocx after pushing new value to Vec causing it to resize | Im getting this very interesting segfault when using with CStrings in a project Im working on. ``` Program received signal SIGSEGV, Segmentation fault. 0x0000555555574551 in je_rallocx () Missing separate debuginfos, use: dnf debuginfo-install fcgi-2.4.0-28.fc23.x86_64 (gdb) bt #", "label": "high", "label_id": 1} {"id": "rust_27879", "text": "rustc --color=never prints colours | ``` rustc --color=never error: no input filename given ``` the “error:” in the message above is coloured red. | labels: A-frontend", "label": "medium", "label_id": 2} {"id": "rust_27886", "text": "Bitrig x86_64 test failures. | After the new snapshots landed, test failures showed up. | labels: O-x86_64", "label": "medium", "label_id": 2} {"id": "rust_27889", "text": "borrowck cares about field names with disjoint enum downcasts | ## STR This compiles: ``` Rust pub enum Foo { X { foo: u32 }, Y { bar: u32 } } pub fn foo(mut x: Foo) { let mut y = None; let mut z = None; if let Foo::X { ref foo } = x { z = Some(foo); } if let Foo::Y { ref mut bar } = x { y = Some(bar); } drop((y, z)); } fn main() {} ``` If yo | labels: A-borrow-checker", "label": "medium", "label_id": 2} {"id": "rust_27890", "text": "ICE when trying to make a static closure | After some discussing about static closures on IRC, I was messing around and found an ICE: ``` static plus_one: &'static Fn(i32) -> i32 = (&|x: i32| { x + 1 }) as &'static Fn(i32) -> i32; ``` ``` error: internal compiler error: coherence failed to report ambiguity: cannot locate | labels: I-ICE, A-closures", "label": "high", "label_id": 1} {"id": "rust_27895", "text": "internal compiler error: literals of different types in range pat | code: ``` fn main() { let i = 5; let index = 6; match i { 0...index => println!(\"winner\"), _ => println!(\"hello\"), } } ``` backtrace: ``` $ RUST_BACKTRACE=1 rustc hello.rs hello.rs:6:13: 6:18 error: paths in constants may only refer to constants or functions [E0014] hello.rs:6 0. | labels: E-needs-test", "label": "high", "label_id": 1} {"id": "rust_27898", "text": "Rust1.2 Windows7 64bit, rust-openssl issue or a rust-gcc issue | https://users.rust-lang.org/t/i-try-to-build-a-nickel-example-but-gap-at-openssl-sys-0-6-4/2528/5 Please refer to the forum post. We cannot build OpenSSL at Win7 64bit enviroment by Rust1.2 even I have install openssl at C:\\OpenSSL-Win64 and set ENV already. Please help to resolv", "label": "medium", "label_id": 2} {"id": "rust_27899", "text": "Small inconsistency with `self`: keyword but sometimes ident | In the following example `self` is accepted as an `ident` in a macro, that is an **identifier**: ``` rust #![allow(dead_code)] macro_rules! foo { ($this:ident) => ($this) } struct Bar; impl Bar { fn bar(self) -> Self { foo!(self) } } fn main() {} ``` [on playpen](http://is.gd/ztU | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_27901", "text": "assertion failed: !projection_ty.has_escaping_regions() from astconv | ## STR ``` Rust trait Stream { type Item; } impl<'a> Stream for &'a str { type Item = char; } fn f<'s>(_: &'s str) -> (&'s str, <&'s str as Stream>::Item) { loop {}} fn main() { f as for<'t> fn(&'t str) -> (&'t str, <&'t str as Stream>::Item); } ``` ## ICE ``` thread 'rustc' pani | labels: I-ICE, A-trait-system", "label": "high", "label_id": 1} {"id": "rust_27906", "text": "Drop skipped on panic | I was working on a patch for @bluss's arrayvec and ran into the following issue. In the code below, I'm trying to keep the `Test` struct from dropping twice even if it panics on drop. If I explicitly drop the `Test` when reading it out of the array (using `ptr::read`), everything", "label": "medium", "label_id": 2} {"id": "rust_27908", "text": "Tracking issue for drop_in_place | This calls the \"drop glue\" for a given type without having to explicitly read it out onto the stack to be dropped. All types have a drop glue implementation, which involves calling the types Drop impl (if it exists), and the recursively running drop glue on its fields. drop_in_pl | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_27909", "text": "Write nomicon dot-operator section | https://doc.rust-lang.org/nightly/nomicon/dot-operator.html", "label": "medium", "label_id": 2} {"id": "rust_27910", "text": "Write nomicon Implementing Arc and Mutex chapter | https://doc.rust-lang.org/nightly/nomicon/arc-and-mutex.html", "label": "medium", "label_id": 2} {"id": "rust_27911", "text": "Rewrite nomicon references section | https://doc.rust-lang.org/nightly/nomicon/references.html This involves solving the incredibly difficult question of \"what on earth are Rust's True Pointer Aliasing Rules\". CC @aturon @arielb1 @nikomatsakis @pnkfelix @sunfishcode", "label": "question", "label_id": 4} {"id": "rust_27917", "text": "Book: \"Prelude\" explanation could be more prominent/thorough | \"Prelude\" doesn't seem to be a very common term outside of Haskell, yet it seems to only be explained in the Guessing Game section of the book. Even then, it only mentions it being the stuff imported by default, which doesn't explain `std::io::prelude`.", "label": "medium", "label_id": 2} {"id": "rust_27918", "text": "Broken MIR with const match | ### empty_and_catchall ``` rust fn empty_and_catchall(raw: &[u8]) { let mut iter = raw.split(|&b| b == b'/'); let first = iter.next().unwrap(); let second = iter.next(); const EMPTY: &'static [u8] = b\"\"; match (first, second) { (EMPTY, Some(EMPTY)) => (), _ => (), } } fn main() { | labels: I-ICE, C-bug", "label": "question", "label_id": 4} {"id": "rust_27923", "text": "Cargo: produce deterministic filenames for `build --test` and `test --no-run` | I'm doing IDE integration, and I want my IDE to be able to debug the test binaries - for which the IDE has to launch those programs itself, it shouldn't use `cargo test`. However (unlike `--bin`for example) neither `build --test` nor `test --no-run` produce a deterministic filena", "label": "medium", "label_id": 2} {"id": "rust_27925", "text": "compiler crash on stable, beta, nightly | ``` rust struct Sched { i: i32, } impl Sched { extern \"C\" fn get(self) -> i32 { self.i } } fn main() { let s = Sched { i: 4 }; let f = || -> i32 { s.get() }; println!(\"f: {}\", f()); } ``` stable/beta: ``` Stored value type does not match pointer operand type! store { i64 } %0, i3 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27928", "text": "Not possible to get pid and stdout on a spawned process | Using the unstable Child `.id()` API it does not seem possible to both get the PID and stdout. I have created reproducible code and output [here](https://gist.github.com/joewilliams/7516a093e192adf72af2). I believe this may be due to the use of `.spawn()` and `.wait_with_output()", "label": "medium", "label_id": 2} {"id": "rust_27932", "text": "dining philosophers does not actually exhibit deadlock | In the Dining Philosophers doc page, the `eat` function is implemented: ``` fn eat(&self, table: &Table) { let _left = table.forks[self.left].lock().unwrap(); let _right = table.forks[self.right].lock().unwrap(); println!(\"{} is eating.\", self.name); thread::sleep_ms(1000); print", "label": "medium", "label_id": 2} {"id": "rust_27933", "text": "Binary releases of Rust targeting musl | The [Rust 1.1.0 blog post](http://blog.rust-lang.org/2015/06/25/Rust-1.1.html) said that nightly binary releases of Rust using musl instead of glibc on Linux were coming. I am not spotting any in [this distribution index](https://static.rust-lang.org/dist/index.html). Is this sti", "label": "question", "label_id": 4} {"id": "rust_27936", "text": "Improve book support for windows | https://doc.rust-lang.org/stable/book/testing.html could be improved by mentioning `echo %errorlevel%` for use in Windows. Perhaps an appendix for Windows?", "label": "question", "label_id": 4} {"id": "rust_27940", "text": "from_raw_parts needs an equivalent for dynamically-sized structs | There's no good way to generate a non-raw pointer to a struct with a DST in tail position, which would handy for some FFI use cases involving flexible array members and the like. You can fake it in stable Rust, but only by abusing `transmute`: ``` rust struct PascalString Methods take a special first parameter, of which there are three variants: `self`, `&self`, and `&mut self`. The reference uses typed self in a few places, but doesn't explain the exact rules. The compiler also prints redundant and misleading diagnostics: ``` r | labels: A-diagnostics, T-lang, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_27942", "text": "DestructionScopeData can leak into error messages | ``` Rust pub trait Resources<'a> {} pub trait Buffer<'a, R: Resources<'a>> { fn select(&self) -> BufferViewHandle; // should be BufferViewHandle<'a, R> } pub struct BufferViewHandle<'a, R: 'a+Resources<'a>>(&'a R); fn main() {} ``` Post-RFC1214, this gives the not-particularly | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27946", "text": "Code in E0139 explanation is not valid anymore | ``` let result: SomeType = mem::uninitialized(); unsafe { copy_nonoverlapping(&v, &result) }; result // `v` transmuted to type `SomeType` ``` std::ptr::copy_nonoverlapping takes 3 arguments, but only 2 are provided. It also does not typecheck anymore either. | labels: E-easy", "label": "low", "label_id": 3} {"id": "rust_27949", "text": "`==` operator does not support subtyping | Here's an example showing this behavior: ``` rust struct Input<'a> { foo: &'a u32 } impl <'a> std::cmp::PartialEq> for Input<'a> { fn eq(&self, other: &Input<'a>) -> bool { self.foo == other.foo } fn ne(&self, other: &Input<'a>) -> bool { self.foo != other.foo } } // sa | labels: E-easy, E-needs-test", "label": "question", "label_id": 4} {"id": "rust_27950", "text": "Can `derive` be smarter about lifetime parameters? | briansmith on IRC ran into trouble using `#[derive(PartialEq)]` on a struct with a lifetime parameter. See the code at http://is.gd/R6Jx2x which fails with: ``` :8:59: 8:65 error: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requiremen | labels: A-syntaxext", "label": "medium", "label_id": 2} {"id": "rust_27951", "text": "Compiler panic on std::str::FromStr::Err import | I receive a panic in the compiler when attempting to build the following code. I am just learning rust so I have no idea if this could would actually work, but I am assuming it should not panic. I tried this code: ``` rust use std::str::FromStr::Err; fn main() { } fn usage_error(", "label": "medium", "label_id": 2} {"id": "rust_27952", "text": "cfail tests do not check for unexpected errors on windows | Currently the cfail test runner works by parsing rustc's stderr, and scanning the output for errors/warnings. It uses the pattern `:: [error|warning]` to check whether a line of output is an unexpected error. This never succeeds on windows, because absolute p | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_27953", "text": "Trait object lifetime issues | The following code seems like it should typecheck fine, but doesn't. ``` rust struct S; trait T { } impl AsRef for S { fn as_ref(&self) -> &T { unimplemented!() } } ``` `error: method `as_ref` has an incompatible type for trait: expected bound lifetime parameter , found concre | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27954", "text": "ICE: creating trait object with function that has stricter bounds on associated type. | ``` rust use std::marker::PhantomData; pub trait Filterable { type Filter; } pub trait ComponentMapper { type Component; fn entities_filtered(&self, ::Filter) where Self::Component: Filterable; } pub struct VecMapper { _marker: ::std::marker::Pha | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27955", "text": "ICE when creating a trait object with fn with additional bounds on associated items | ``` rust use std::marker::PhantomData; pub trait Filterable { type Filter; } pub trait ComponentMapper { type Component; fn entities_filtered(&self, ::Filter) where Self::Component: Filterable; } pub struct VecMapper { _marker: ::std::marker::Pha", "label": "high", "label_id": 1} {"id": "rust_27958", "text": "Any trait documentation mentions non-existing methods | In the paragraph about the [any module](https://doc.rust-lang.org/stable/std/any/index.html): > Any itself can be used to get a TypeId, and has more features when used as a trait object. As &Any (a borrowed trait object), it has the is and **as_ref** methods, to test if the conta", "label": "medium", "label_id": 2} {"id": "rust_27959", "text": "Tests output without color when RUST_TEST_NOCAPTURE=1 is set | Is it design so or a bug? platform:win7 x64 rustc 1.2.0 (082e47636 2015-08-03) tests output with color: ![color](https://cloud.githubusercontent.com/assets/4688041/9428055/5916ee66-49ce-11e5-8003-adec646282ac.png) after set RUST_TEST_NOCAPTURE=1 in console tests output without co", "label": "medium", "label_id": 2} {"id": "rust_27963", "text": "Link error when a public module exposes types from a private module | Compilation of: ``` rust mod privmod { pub struct HiddenType; impl HiddenType { pub fn hidden_method(&self) { } } } pub mod pubmod { use privmod; pub fn expose() -> privmod::HiddenType { privmod::HiddenType } } pub use pubmod::expose; ``` produces the warning: > warning: method i", "label": "medium", "label_id": 2} {"id": "rust_27964", "text": "Note where implicit Sized requirement comes from | I was not aware that `Sized` is a default requirement for type parameters, so I was very confused why [this code doesn't compile](https://play.rust-lang.org/?code=%0Atrait%20OopsSized%3CO%20%2F*%20missing%20%3A%20%3FSized%20*%2F%3E%20%7B%0A%20%20%20%20fn%20observers%28%26self%29% | labels: C-enhancement, A-diagnostics, T-compiler, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_27965", "text": "No way to timeout when receiving from a Receiver | It apparently used to be possible to timeout on `Receiver::recv` by using a `Timer` and `select!`. Now that `Timer` is gone, that's not possible. Either something like `Timer` should be re-introduced, or something similar to `Receiver::try_recv` could be added which accepts a tim", "label": "medium", "label_id": 2} {"id": "rust_27967", "text": "macro_rules cannot expand `concat!(...)` into a variant arm | Here is a reduced example of the bug: ``` rust macro_rules! foo { ($key:expr) => { match \"foobar\" { $key => \"\", _ => \"\", } } } fn main() { foo! { concat!(\"foo\", \"bar\") }; } ``` This errors with: ``` foo.rs:4:13: 4:17 error: unexpected token: `concat!(\"foo\" , \"bar\")` foo.rs:4 $key | labels: A-macros, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_27969", "text": "Type parameters not allowed on Result | ``` rust fn main() { let () = Result::<(), ()>::Ok(()); //let () = Result::Ok::<(), ()>(()); // <-- This is what I meant to do } ``` gives: ``` :2:23: 2:25 error: type parameters are not allowed on this type [E0109] :2 let () = Result::<(), ()>::Ok(()); ^~ ``` This is | labels: C-enhancement, A-diagnostics", "label": "low", "label_id": 3} {"id": "rust_27970", "text": "set_var/remove_var are unsound in combination with C code that reads the environment | Like the documentation for our `set_var` (setenv) says, care must be taken with mutating environment variables in a multithreaded program. See [this glibc bug #13271](https://sourceware.org/bugzilla/show_bug.cgi?id=13271) that says getaddrinfo may call getenv. It looks like we ha | labels: A-concurrency, P-medium, I-unsound, C-bug, E-needs-mcve, T-libs", "label": "question", "label_id": 4} {"id": "rust_27973", "text": "std::net::AddrParseError doesn't implement std::error::Error | I was writing a generic argument parse validator for my program, which involved matching errors from FromStr::parse. After constraining the error type to Error, I ran into an issue when creating a validator for parsing IP addresses: ``` main.rs:48:24: 48:47 error: the trait `std:", "label": "medium", "label_id": 2} {"id": "rust_27977", "text": "Supply snapshot source tarballs for src/snapshots.txt | It would be great if, in addition to the nightly tarballs, there were .tar.gz's for every snapshot listed in `src/snapshots.txt`. This would make snapshot creation on e.g. DragonFly simpler, as it could be more easily integrated into the ports system, which do not like fetching s", "label": "medium", "label_id": 2} {"id": "rust_27979", "text": "Fix a number of `run-make` tests on MSVC. | Due to the way MSYS sandboxes file paths, paths passed to `cl.exe` are expanded into values which are invalid outside of MSYS. | labels: A-testsuite, O-windows", "label": "medium", "label_id": 2} {"id": "rust_27985", "text": "the compiler unexpectedly panicked with message \"no type for node\" | $ RUST_BACKTRACE=1 rustc bug.rs ``` error: internal compiler error: no type for node 17: pat _ (id=17) in fcx 0x7ff96bbf0100 note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING | labels: I-ICE, E-needs-test, C-bug", "label": "high", "label_id": 1} {"id": "rust_27987", "text": "Lifetime in trait method declaration affects RFC 1214 checks | ``` rust trait Test { fn f<'a>(&self) where PartialEq : std::fmt::Display {} } trait Test2 { fn f<'a>(&self) where (PartialEq + 'a) : std::fmt::Display {} } fn main() { } ``` Currently, Test1 triggers an \"error\", but Test2 doesn't. I would expect them to be treated the | labels: A-lifetimes, A-trait-system, P-low, T-lang, C-bug, T-types", "label": "low", "label_id": 3} {"id": "rust_27989", "text": "ICE on trait with mixed lifetimes | This code generates ``` rust trait Y<'a>: Sized { fn f(&'a self) { } fn g(&self) where Self: for<'r> Y<'r> { self.f(); } } ``` this ICE ``` txt :6:14: 6:17 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `Y<'_>` for | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_27990", "text": "Incorrect error message when attempting to access field on struct constructor | [playpen](http://is.gd/rb25Yu) ``` rust struct MyStruct { field: u8 } fn main() { MyStruct.foo; } ``` results in ``` :4:5: 4:13 error: `MyStruct` is the name of a struct or struct variant, but this expression uses it like a function name [E0423] :4 MyStruct.foo; ^~~~~ | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_27993", "text": "ToOwned is implemented for all reference types | This occurred while trying to convert instances of `str.to_string()` to `to_owned()`. When the receiver is of type `&&str` (or `&&&str`, etc.) this will \"mysteriously\" fail to work since you get back a `&str`. The reason seems to be that the general implementation of `ToOwned` fo", "label": "medium", "label_id": 2} {"id": "rust_27996", "text": "IntoIterator not implemented for &Option and &Result | To be consistent with Vec and other collections, shouldn't these types also get the IntoIterator impls for `&T` and `&mut T`?", "label": "medium", "label_id": 2} {"id": "rust_27997", "text": "trans monomorphizes dtors that have a different parameter order wrong | ## STR ``` Rust use std::fmt; struct T2(U,V); impl Drop for T2 { fn drop(&mut self) { println!(\"{}\", self.1); } } fn main() { let _ = T2((), 1); } ``` ## Expected result Should print `1` (or fail to compile) ## Actual result ``` : | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28002", "text": "\"Could not compile `advapi32-sys` on a network-mapped drive | I attempted to run the command: cargo build --verbose and got the following error: ``` powershell PS Q:\\projects\\hello_world\\src> cargo build --verbose Compiling advapi32-sys v0.1.2 Running `rustc C:\\Users\\\\.cargo\\registry\\src\\github.com-0a35038f75765ae4\\advapi32-sys-0.1.2\\ | labels: I-ICE, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_28005", "text": "No terminal color with Git for Windows 2.5 (mintty.exe) | I am using 1.3 beta and previously was using Git for Windows 1.9.5 with the msys terminal. Rustc output had pretty colors, but then today I upgraded to Git for Windows 2.5, which includes the mintty.exe replacement terminal (w/ bash shell). The terminal itself has colored text, s", "label": "question", "label_id": 4} {"id": "rust_28008", "text": "placing large array inside Box causes stack overflow | I was trying to store a large array on the heap, the code produced a run-time error of stack overflow. ``` rust fn main() { let x = Box::new([0; 10_000_000]); } ``` I expected the array to be initialised on the heap. Instead it seems, the array is being initialised onto the stack", "label": "medium", "label_id": 2} {"id": "rust_28011", "text": "Friendlier compiler message for incorrect trait method signatures | When implementing a trait, it would be useful to see the expected method signature in compiler error messages. Example ``` impl std::fmt::Display for MyType { // Not sure what to put here so I stub it and hope to get help from error fn fmt() -> () { } } ``` The current error mess | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28012", "text": "i32::pow only handles overflow up to an exponent of 1023 | Playpen: http://is.gd/zhwksu ``` rust fn main() { let x: i32 = 2; println!(\"{}\", x.pow(1024)); println!(\"{}\", x.pow(1023)); } ``` Prints: ``` 0 thread '
' panicked at 'arithmetic operation overflowed', ../src/libcore/num/mod.rs:550 ``` Interestingly, this only seems to happe", "label": "medium", "label_id": 2} {"id": "rust_28014", "text": "mod names that collide with primitive types should link to primitive type docs | A (personal) user experience: While looking for matching functionality on `str`, I went to the following link: - `mod str`: https://doc.rust-lang.org/std/str/index.html - note that this is distinct from primitive `str`: https://doc.rust-lang.org/std/primitive.str.html - you may n", "label": "low", "label_id": 3} {"id": "rust_28018", "text": "windows-msvc builds very fragile | `./configure` for -msvc freely interchanges between windows/msys commands, which results in it being quite fragile: it's a good idea to treat msys as a purely unix-like environment, and then have a single escape-hatch to execute windows commands (eg. via cmd). Ways this can curre | labels: O-windows", "label": "question", "label_id": 4} {"id": "rust_28019", "text": "make check fails on c-dynamic-dylib on windows | Running make check fails with this error message when run in on windows. ``` ------ stderr --------------------------------------------- error: linking with `gcc` failed: exit code: 1 note: \"gcc\" \"-Wl,--enable-long-section-names\" \"-fno-use-linker-plugin\" \"-Wl,--nxcompat\" \"-static | labels: O-windows, T-bootstrap, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28024", "text": "Generic type defaults should not be allowed if they don’t satisfy type constraints | As spotted in [this internals thread](https://internals.rust-lang.org/t/interaction-of-user-defined-and-integral-fallbacks-with-inference/2496/23?u=nagisa): ``` rust use std::fmt::Debug; struct Foo; fn show(t: T) { println!(\"{:?}\", t) } ``` compiles. Lack of early | labels: A-type-system, P-medium, T-lang, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28025", "text": "[MSVC] Rustc is producing inappropriate filetypes w/ `--crate-type=dylib` && `--crate-type=staticlib`. | For example: ``` sh /C/msys64/home/Richard/rust-build/x86_64-pc-windows-msvc/stage2/bin/rustc.exe --out-dir /C/msys64/home/Richard/rust-build/x86_64-pc-windows-msvc/test/run-make/output-type-permutations -L /C/msys64/home/Richard/rust-build/x86_64-pc-windows-msvc/test/run-make/ou", "label": "medium", "label_id": 2} {"id": "rust_28032", "text": "Implement new semantics for lines(), deprecate lines_any() | Tracking issue for https://github.com/rust-lang/rfcs/pull/1212 | labels: B-RFC-approved, T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_28036", "text": "ICE - 'path not fully resolved' with type alias to an array type with undefined size | It appears that when a type alias to array type which uses an undefined constant for it's size is defined, the compiler crashes. I have only been able to reproduce this with the constants defined in uint modules. This code ``` rust // This line prevents the crash // use std::usiz", "label": "high", "label_id": 1} {"id": "rust_28037", "text": "Anomalous unstable feature annotations | After submitting #28031, I ran a [script](https://gist.github.com/durka/a5243440697c780f669b) on the rest of src/ and I found several feature annotations that seem anomalous. A few I thought were obvious and I submitted another PR #28038. This short list contains the ones that I'", "label": "medium", "label_id": 2} {"id": "rust_28040", "text": "Panic in libsyntax/ext/quote.rs | Using a macro argument (e.g. $x) inside of quote_expr! causes an internal compiler error. ## Testcase ``` #![feature(quote)] fn main() { macro_rules! foo { ($bar:expr) => {{ quote_expr!(cx, { $bar }) }} } foo!(0); } ``` ## Meta `rustc --version --verbose`: rustc 1.5.0-nightly (32 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28041", "text": "Can't expand macro inside slice pattern | ``` rust #![feature(slice_patterns)] macro_rules! m { () => ( c.. ); } fn main() { match [0, 1, 2] { [ c.. ] => {} [ m!() ] => {} } } ``` Gives this error: ``` :4:14: 4:16 error: macro expansion ignores token `..` and any following :4 () => ( c.. ); ^~ :10:11: 1 | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28050", "text": "Set recovery methods | Tracking issue for https://github.com/rust-lang/rfcs/pull/1194 cc https://github.com/rust-lang/rust/pull/28043 | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_28053", "text": "FFI guide should be more explicit about the libc crate | https://doc.rust-lang.org/book/ffi.html#interoperability-with-foreign-code in general says > The standard library includes type aliases and function definitions for the C standard library in the libc module, Which is wrong. Reported in https://news.ycombinator.com/reply?id=101327", "label": "medium", "label_id": 2} {"id": "rust_28055", "text": "Inconsistency in type checking where clauses in trait definition | In this example, function `f` compiles, but `g` does not. To make `g` compiles it's necessary to repeat the `C` definition bound. For function `f` this is not necessary. This seems to be an inconsistency. ``` rust trait A { fn a(&self); } trait B where Self: A { fn b(&self); } tr", "label": "medium", "label_id": 2} {"id": "rust_28056", "text": "Add a toc to each std lib generated pages | Long pages such as in [regex](http://doc.rust-lang.org/regex/regex/index.html) have many examples but it's difficult to know at a glance what the documentation contains without scanning the entire document. Having a table of contents would help a lot with this. Here is a list of | labels: T-rustdoc, C-enhancement, T-dev-tools", "label": "low", "label_id": 3} {"id": "rust_28058", "text": "Better document that process::exit does not result in a clean shutdown | The documentation states `If a clean shutdown is needed it is recommended to only call this function at a known point where there are no more destructors left to run.`, however simply running it when no more destructors are left to run does not guarantee a clean exit. For example", "label": "medium", "label_id": 2} {"id": "rust_28059", "text": "Rename Rust to be less discriminatory towards noble metals | Rust should be renamed to something which does not discriminate against noble metals. Not all metals corrode, such as ruthenium, rhodium, palladium, silver, osmium, iridium, platinum, and gold, and yet they still make significant contributions to society and thus should not be ig", "label": "medium", "label_id": 2} {"id": "rust_28061", "text": "match String as str inside enum | I've confused by this matching: ``` rust enum E { Container(String) } fn main() { let e = E::Container(String::from(\"data\")); match e { E::Container(\"data\") => println!(\"Match\"), _ => println!(\"No match\"), } } ``` Error: ``` rust :9:22: 9:28 error: mismatched types: expecte", "label": "medium", "label_id": 2} {"id": "rust_28062", "text": "No verification on intrinsic function number of arguments | The following code will compile: ``` Rust #![feature(repr_simd, platform_intrinsics)] #[repr(simd)] struct f64x2(f64, f64); extern \"platform-intrinsic\" { fn x86_mm_movemask_pd(x: f64x2, y: f64x2, z: f64x2) -> i32; } ``` but it shouldn't because the function takes only one `f64x2`", "label": "medium", "label_id": 2} {"id": "rust_28064", "text": "Document use _ as _ syntax | /u/DroidLogician on reddit [mentioned](https://www.reddit.com/r/rust/comments/3ink8q/is_there_a_way_to_include_a_crate_that_shares_a/cuifk8p) that the `use _ as _` syntax is undocumeted, at least in the crates and module chapter of TRPL. @steveklabnik, this seems like your territ", "label": "medium", "label_id": 2} {"id": "rust_28065", "text": "rt::atexit callbacks don't run after exit(0) call | Specifically, the stdout buffer doesn't flush: from #28058: > `fn main() { print!(\"Hi!\"); }` results in \"Hi!\", `fn main() { print!(\"Hi!\"); std::process::exit(0); }` results in no output. We should probably just be using libc atexit here. cc @alexcrichton", "label": "medium", "label_id": 2} {"id": "rust_28066", "text": "Building coreutils with LTO causes LLVM error | Building [coreutils](https://github.com/uutils/coreutils) with LTO: ``` make ENABLE_LTO=y ENABLE_STRIP=y ``` causes the following error: ``` ... rustc -O -L /Users/gustavo.hexsel/Dev/coreutils/build/ -C lto --extern uufalse=/Users/gustavo.hexsel/Dev/coreutils/build/libfalse.rlib | labels: A-linkage, A-LLVM", "label": "medium", "label_id": 2} {"id": "rust_28071", "text": "`include!`ed files are unable to #[macro_use] | This makes using codegen a bit more cumbersome. What happens: `main_real.rs`: ``` // main_real.rs: #[macro_use] extern crate log; fn main() { info!(\"Hi!\"); } ``` `main.rs`: ``` include!{\"main_real.rs\"} ``` `Cargo.toml`: ``` [package] name = \"macro-use-include\" version = \"0.1.0\" a | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28072", "text": "Types do not expand hygienically in macros that create modules | If I take a macro parameter of type `ty`, and in the macro I create a module and expand `ty` within that module, the name of the type is parsed within the module, not within the context of the macro, which subtly breaks hygiene. For instance ([playpen](http://is.gd/yNseM4)): ``` | labels: P-low, A-macros", "label": "low", "label_id": 3} {"id": "rust_28073", "text": "Read::bytes() is a performance trap | ``` rust use std::fs::File; use std::io::Read; use std::io::BufReader; fn main() { let f = File::open(\"/usr/share/dict/words\").unwrap(); let f = BufReader::new(f); let mut count = 0; for b in f.bytes() { if b.ok() == Some(b'a') { count += 1 } } println!(\"{}\", count); } ``` On my ", "label": "medium", "label_id": 2} {"id": "rust_28074", "text": "Read::bytes() and Read::chars() iterators should ignore Interrupted errors | https://github.com/rust-lang/rust/blob/fd302a95e1197e5f8401ecaa15f2cb0f81c830c3/src/libstd/io/mod.rs#L1549 etc.; `Interrupted` errors should be ignored here for the same reason they are ignored with `BufRead::lines()`. | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_28075", "text": "`use` of unstable function is not gated in import list | This compiles on stable: `use std::thread::{catch_panic};` but this does not: ``` use std::thread::catch_panic; error: use of unstable library feature 'catch_panic': recent API addition ``` Fortunately, I can't find a way to actually use the import anyway, but it's a stability tr | labels: E-easy, P-high, T-libs-api", "label": "high", "label_id": 1} {"id": "rust_28076", "text": "Show library version number in the rust doc | When I read the documentation of the rust standard library from google, I don't know to which version of rust it refers. It could be great to have a footer with the version and a text which appear when we put our cursor on the rust logo which display the version of the library th", "label": "medium", "label_id": 2} {"id": "rust_28082", "text": "Document the rules for `extern crate` in doc tests | It's not clear from the documentation how to use external crates in doc tests. This should be documented in the testing section of the book. This is related to rust-lang/cargo#960.", "label": "medium", "label_id": 2} {"id": "rust_28084", "text": "Local ambiguity in macro *definition* | ``` rust macro_rules! m { () => ();; } ``` ``` :2:14: 2:15 error: local ambiguity: multiple parsing options: built-in NTs tt ('lhs') or 1 other options. :2 () => ();; ^ ``` (the equivalent of `$( $lhs:tt => $rhs:tt );+ $(;)*` is used to parse macros) This leaks \"lhs\", | labels: A-diagnostics, A-parser, A-macros, T-compiler, C-bug, D-confusing", "label": "medium", "label_id": 2} {"id": "rust_28085", "text": "Macros accept empty repetitions which hang the compiler | This causes an infinite loop: ``` rust macro_rules! m { ( $()+ ) => (); } m!(); ``` | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28089", "text": "rustc panic with docopt_macros | Compiling the following `main.rs` with `rustc` d877e6540 (driven by rust-lang/cargo@1b902d4): ``` rust #![feature(plugin)] #![plugin(docopt_macros)] docopt!(Args, \" Usage: foo (--help | --version) Options: -h, --help Show this message --version Show the version of foo \"); ``` I g | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28091", "text": "no_debug and omit_gdb_pretty_printer_sections attributes exist and are ungated | This compiles without a peep from the compiler: ``` rust #[no_debug] #[omit_gdb_pretty_printer_section] fn main() {} ``` The later especially seems to be purely designed for the rust testsuite, so should probably be feature gated. (Nominating for more discussion and some sort of | labels: E-easy, A-attributes, P-medium, E-mentor, A-stability, T-compiler", "label": "question", "label_id": 4} {"id": "rust_28092", "text": "Weird lifetime error with closure and early-bound lifetime | ``` rust struct S; impl S { fn f<'a:'a>(_x:&'a i32) {} } fn main() { let g1: &Fn(&i32) = &|x| S::f(x); g1(&1); let g2 = &|x| S::f(x); g2(&1); } ``` ``` :9:9: 9:10 error: borrowed value does not live long enough :9 g2(&1); ^ :8:27: 10:2 note: reference must be va | labels: C-enhancement, A-lifetimes, A-closures, fixed-by-NLL", "label": "low", "label_id": 3} {"id": "rust_28093", "text": "Private `Recover` trait is visible in `BTreeMap` docs | It shows up on https://doc.rust-lang.org/nightly/std/collections/struct.BTreeMap.html and https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.BTreeMap.html, but not on https://doc.rust-lang.org/nightly/collections/struct.BTreeMap.html or https://doc.rust-lang.org/n", "label": "low", "label_id": 3} {"id": "rust_28095", "text": "`fs::read_link` on OS X removes the root, returning an invalid path. | The [documents](http://doc.rust-lang.org/nightly/std/fs/fn.read_link.html) are not very clear about what it should return but I have to guess it should be an absolute path: ` Reads a symbolic link, returning the file that the link points to. ` It should say \"(absolute) path to th", "label": "medium", "label_id": 2} {"id": "rust_28098", "text": "Report same/similar errors only once | It seems that https://github.com/rust-lang/rust/issues/20692 is not only a case for duplicate error messages as shown by ``` rust fn main() { let array = [1, 2, 3]; for a in array { println!( \"{}\", a); } } ``` Which print the error 3 times. It is the same as the other case about | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28099", "text": "ICE at static boxed mutable function | I tried this code: ``` rust static no_op : Box = Box::new(move |_| { }); fn main() { } ``` I expected it to compile cleanly or give me a helpful error. Instead, it gave me a helpful error and then an ICE: ``` src/bug_repro.rs:1:34: 1:56 error: function calls in static | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28100", "text": "Update Rustonomicon to mention contravariance | [Claiming that rust does not use contravariance in its type system](https://doc.rust-lang.org/nightly/nomicon/subtyping.html#variance) seems to be an error. The Rustonomicon should be updated. I've already been confused enough since I took the \"it does not exist\" as a fact. Quoti | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_28104", "text": "ICE: constant expression should not reach expr::trans_def | Code that reproduces the ICE: ``` rust fn main() { std::u8::MAX; } ``` ``` :2:5: 2:18 warning: path statement with no effect, #[warn(path_statements)] on by default :2 std::u8::MAX; ^~~~~~~~~~~~~ :2:5: 2:17 error: internal compiler error: constant expression sho | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28105", "text": "Bad span assigned to continue keyword | The break expression span contains its keyword, but the one for continue does not: http://is.gd/phbWGX cc https://github.com/nrc/rustfmt/issues/184", "label": "medium", "label_id": 2} {"id": "rust_28108", "text": "continue and break keyword related errors invalidly include the next token into span | Once https://github.com/rust-lang/rust/issues/28105 is fixed, there’s still an issue of both `continue` and `break` keyword spans including a token after the keyword into a span. e.g. for ``` rust fn main() { break } ``` span includes the closing brakcet ``` :1 fn main() { ", "label": "medium", "label_id": 2} {"id": "rust_28109", "text": "use of undeclared label error message has a wrong span | It includes both the `break`/`continue` keywords as well as the label name, when only the label should be spanned: e.g. ``` :1:13: 1:22 error: use of undeclared label `'a` :1 fn main() { break 'a; } ^~~~~~~~~ ```", "label": "medium", "label_id": 2} {"id": "rust_28110", "text": "chars() iterator no longer compiling | Back a couple weeks ago, I had a program with this code here: ``` rust for ch in msg.chars() { if !ch.is_alphabetic() { continue; } let s = caesar_shift(ch, key); e.push(s); } ``` This code compiled just fine, where msg is an `&str` parameter to the function in question. Now, hav", "label": "question", "label_id": 4} {"id": "rust_28111", "text": "Windows TLS destructors don't run in a statically linked binary | On `-msvc` TLS destructors do not appear to be run at all. On `-gnu` TLS destructors appear to run when a non-main thread exits (as expected) or `std::process:exit` is called (es expected), but not run when main thread is terminated normally (by returning from `fn main`; not expe | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_28112", "text": "Should we default to jemalloc on OpenBSD, FireflyBSD and Bitrig? | Supported since [jemalloc 4.0](https://github.com/jemalloc/jemalloc/releases/tag/4.0.0)", "label": "question", "label_id": 4} {"id": "rust_28113", "text": "ICE in rustc from function call in RHS of const definition | I tried this code: ``` const X: u8 = || -> u8 { 5 }(); ``` I expected to see this happen: Either a compilation error, or to be equivalent to const X: u8 = 5. Instead, this happened: Internal compiler error ## Meta `rustc --version --verbose`: ``` rustc 1.4.0-nightly (20a8412e0 20 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28114", "text": "LLVM ICE using maud and iron | Reproduction: https://gist.github.com/anonymous/ecaa67ead6b561fb8d39 The full error from `cargo build`: ``` Compiling iron-maud v0.1.0 (file:///Users/reem/code/iron/iron-maud) Global is external, but doesn't have external or weak linkage! i8 (%closure.66*, i8*, void (i8*)**)* @_Z", "label": "medium", "label_id": 2} {"id": "rust_28118", "text": "Operator bound breaks type inference | I would expect this to compile, but it doesn't: ``` use std::ops::{Mul}; pub fn calc(x: X) -> f64 where f64: Mul { 2. * 3. } fn main() { } ``` https://play.rust-lang.org/?gist=4c8550ad70d41976729f&version=nightly In math the convention is to write scalar-vector mu | labels: A-trait-system", "label": "medium", "label_id": 2} {"id": "rust_28120", "text": "simplify CFG_FILENAME_EXTRA | I'm wondering what is the rationale behind the hash values appended to the shared objects generated by `rustc` (and `cargo` too apparently, but filing only here for now.) At first I thought the hash was of some file contents, to ensure that unstable stuff doesn't get linked to. b", "label": "medium", "label_id": 2} {"id": "rust_28121", "text": "Extend unused_parens lint to cover plain range literals | For example match `for x in (1..10) { .. }`, but not `for x in (1..10).step_by(2) { .. }`, because in the latter case, the parenthesis are actually needed. This should match expression nodes against `ExprParen(ref inner)` where `inner.node` is a `ExprRange(..)`, and the parent no | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_28124", "text": "Multi-span reporting feature | For some lints, the user experience would be greatly enhanced if we could report a span with multiple highlights. E.g. in a unicode lint, we currently report every matching unicode sequence within a string, which can be _very_ verbose. To reduce the clutter, it would be great if | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28126", "text": "Methods behind a feature gate are still visible to the compiler even when the feature is not on | When a new trait method is found behind a feature gate (such as the `read_exact` method of `io::Read`, which is behind the correspondingly named feature) `rustc` will see the method in scope even if the feature has not been explicitly turned on for the crate. This causes a proble | labels: A-stability, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_28127", "text": "Command::{spawn, status, output} take &mut self unnecessarily | All three are used to actually run the command, and simply delegate to `spawn_inner`, which only requires `&self`. This is confusing because it appears that a `Command` is intended to be reusable, but taking a `&mut self` prevents the command being shared, and suggests that a pas", "label": "medium", "label_id": 2} {"id": "rust_28133", "text": "Incorrect/missing symbol names on msvc backtraces | Symbol names are not properly supported yet on msvc, so backtraces are generally unhelpful. As a result, `run-pass/backtrace.rs` is currently disabled. This issue can be closed when it's been reenabled. | labels: O-windows", "label": "question", "label_id": 4} {"id": "rust_28134", "text": "#![test] on a crate has an... interesting effect | ``` :1:1: 1:4 error: unresolved import `std::prelude::v1::*`. Maybe a missing `extern crate std`? :1 #![test] ^~~ error: aborting due to previous error ``` | labels: E-needs-test, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28139", "text": "HIR: tracking issue for HIR-related things. | Initial landing: #28138 | labels: metabug, T-compiler, A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28140", "text": "HIR: move desugaring to lowering step | Desugaring `if let`, `while let`, and `for` should move to the lowering step, rather than being part of macro expansion. | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28141", "text": "HIR: unify literals and attributes | We freely convert between the AST and HIR versions, I don't think there is any point in there being two versions, so we should just use the AST ones everywhere. | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28142", "text": "HIR: delete the AST after lowering | Unless a tool wants to keep it around. This will require some work on lints to separate AST lints from HIR lints. | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28143", "text": "HIR: cache lowering info | Lowering is O(n) in the number of nodes reached, so could take a while if it happens often (it doesn't at the moment, but could in the future). It might make sense to cache the lowering step, so we can cheaply go from AST to HIR. This is probably most important for tools, rather | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28144", "text": "HIR: remove ids from the AST | I think only the HIR needs ids. | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28145", "text": "HIR: separate AST and HIR lints | Lints are a pain at the moment because they operate on the AST but need type info which belongs to the HIR. We should have two kinds of lints - purely syntactic ones which operate on the (expanded) AST and run early (before AST->HIR lowering) and ones which can access type info a | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28147", "text": "Tracking issue for BinaryHeap::{push_pop, replace} | # Updated issue Tracking issue for - `BinaryHeap::push_pop` - `BinaryHeap::replace` # Original Report std::collections::BinaryHeap has a bunch of unstable methods without proper stability markings; filing an issue to point them at. Someone please label this B-unstable. | labels: T-libs-api, final-comment-period, B-unstable", "label": "medium", "label_id": 2} {"id": "rust_28150", "text": "thread 'rustc' panicked at 'assertion failed: `(left == right)` (left: `...`, right: `...`)', ../src/librustc_borrowck/borrowck/mod.rs:453 | Trying to compile a project of mine via `cargo run` leads to an assertion failure in the borrow checker. The code I introduced that triggered it is in `src/zipper.rs`, function `take` beginning line 86. The code might be a bit nonsensical, since I was just fighting the borrow che | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28151", "text": "Unable to compile tests due to compiler panic | While trying to compile crate test code using `cargo test` the compiler panics. The code is public and the causing commit can be found [here](https://github.com/b52/cogset/commit/73cf6ffd6ce87464df75440ccd064615a60f8afc). The output of the corresponding travis build can be seen [ | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28153", "text": "unused type params on fn lead to difficult to deciper errors at call site | Consider code like this ([playpen](http://is.gd/PxabmK)): ``` rust fn add3(x: i32) -> i32 { x + 3 } fn main() { println!(\"add3(4): {}\", add3(4)); } ``` The Rust compiler currently rejects the above, because it cannot infer what type to assign to the type parameter `T` in the a | labels: A-diagnostics", "label": "question", "label_id": 4} {"id": "rust_28154", "text": "Implement the trait debug for std::collections::BinaryHeap | If I run the following code : ``` rust use std::collections::BinaryHeap; #[derive(Debug)] pub struct MyStruct { bh: BinaryHeap, } fn main() { let m = MyStruct { bh: BinaryHeap::new(), }; } ``` I get the following error : ``` rust test.rs:6:2: 6:21 error: the trait `core::fmt", "label": "medium", "label_id": 2} {"id": "rust_28157", "text": "Expected compile error because bad use of semicolon | Actual result compile and output \"bogus\" Code: https://pastebin.mozilla.org/8844697 rustc 1.4.0-dev (7b7fc67dd 2015-08-13) | labels: A-parser, T-lang", "label": "medium", "label_id": 2} {"id": "rust_28158", "text": "bad span: generics ending with `>>` | ``` #[derive(Copy, Clone)] pub struct StdCounter + Sub> { pub value: T } ``` Apparently, inserting a space between the `>>` fixes the issue. | labels: A-parser", "label": "medium", "label_id": 2} {"id": "rust_28159", "text": "Avoid adding drops for types w/ no dtor in MIR construction | The MIR code currently adds drops for all types that are not `Copy`, even if we can see that there is no destructor (e.g., `struct Foo(u32)`). This is relatively harmless (trans ignores such types) but it means more memory alloc etc than necessary. See associated FIXME. | labels: A-MIR", "label": "medium", "label_id": 2} {"id": "rust_28160", "text": "Settle execution order uncertainty for `+=` | When translating something like `a += b` to MIR, an uncertainty arose about what the semantics of ``` a = 0; a += { a = 22; 2 } ``` ought to be. Should resulting value of `a` be `24` or `2`, basically? The current MIR yields 24, on the basis that this is more-or-less what will ha | labels: P-medium, T-lang, A-MIR, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_28166", "text": "PartialOrd documentation is misleading | The documentation for `cmp::PartialOrd` states that \"if `a < b` then `!(a > b)` and vice versa\", but the \"vice versa\" is somewhat misleading here since `!(a > b)` doesn't imply `a < b` if e.g. either of the values is a NaN float. The author probably wanted to say that `a > b` als", "label": "medium", "label_id": 2} {"id": "rust_28168", "text": "functional struct : no documentation | Consider the following code : ``` rust struct MyStruct; fn main() { let var = MyStruct {}; } ``` The following error message appear : ``` example.rs:4:24: 4:25 error: structure literal must either have at least one field or use functional structure update syntax example.rs:4 let | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28169", "text": "link.exe fail on Windows with MSVC involving logging and generic struct | ``` $ cargo build Compiling libc v0.1.10 Compiling log v0.3.2 Compiling link-crash v0.1.0 (file:///C:/Users/%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80/Document s/link-crash) error: linking with `link.exe` failed: exit code: 1120 note: \"C:\\\\Program Files (x86)\\\\Microso | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_28171", "text": "milliseconds should be represented by u64, not u32 type | I found at least two cases in the standard API where milliseconds are represented by u32 variables: `std::sync::Condvar::wait_timeout_ms()` and `std::thread::park_timeout_ms()`. However unlikely, it is not completely impossible for the user to expect being able to pass parameter ", "label": "medium", "label_id": 2} {"id": "rust_28172", "text": "ICE when non-const in const path. | This is that backtrace and error. ``` ico@arch ted $ cargo run Compiling ted v0.1.0 (file:///home/ico/code/projects/ted) src/text/buffer.rs:112:21: 112:27 error: paths in constants may only refer to constants or functions [E0014] src/text/buffer.rs:112 0.0 ... vwidth => { ^~~~~~ | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28177", "text": "Suggestion for chapter about bindings | Hi, I feel variable bindings need to be explained more. Working and learning alone, it took me quite some time to figure them out (hopefuly I got everything right). Things like: 1. Keyword let declares a new binding - sort of linkage between name and value. It has to be used ONLY", "label": "medium", "label_id": 2} {"id": "rust_28179", "text": "#[no_mangle] is unsafe in the presence of name collisions | On some platforms (at least GNU/Linux, but I hear Windows and several others too), if you link together two static libraries that both export a symbol of the same name, it's undefined which symbol actually gets linked. In practice on my machine, the first library seems to win. Th | labels: A-linkage, P-low, T-lang, T-compiler, I-unsound, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_28180", "text": "rustc: malloc.c:2388: sysmalloc: Assertion failed | I was playing with examples for #28179 and hit this assertion in the playpen. ``` fn main() { println!(\"ok\") } #[no_mangle] #[allow(non_snake_case)] pub fn _ZN2io5stdio6_print20h94cd0587c9a534faX3gE() { std::process::exit(1); } ``` That `#[no_mangle]` function needs to clash with | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28181", "text": "2-line ICE - no entry found for key | `rustc 1.4.0-nightly (7780408af 2015-09-01)` ``` fn bar() where F: Fn([usize; 1]) {} fn main() {} ``` | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28183", "text": "Operator overloading issues | I did a quick search on the bug tracker and didn't find a duplicate so I'll just drop this here : According to the docs, `HashSet` implements `Sub`, but apparently operator overloading fails in this case. Calling `Sub::sub` directly does work. This example also fails with `BTreeS", "label": "low", "label_id": 3} {"id": "rust_28185", "text": "why not derive(Debug) by default | and use attribute #[nodebug] to specific others? in the document, it says > Format trait for the :? format. Useful for debugging, all types should implement this. > Generally speaking, you should just derive a Debug implementation. but sometimes missing it, and I could only manua", "label": "medium", "label_id": 2} {"id": "rust_28189", "text": "ICE with closure in array size | ## STR ``` Rust struct S(T) where [T; (||{}, 1).1]: Copy; fn main() {} ``` ## ICE ``` error: internal compiler error: ParameterEnvironment::from_item(): `unknown node (id=10)` is not an item note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a b | labels: E-easy, E-needs-test, E-mentor", "label": "high", "label_id": 1} {"id": "rust_28196", "text": "Reference paragraph mentions nonexistent example | https://doc.rust-lang.org/nightly/reference.html#match-expressions > A pattern that's just an identifier, like **Nil** in the previous example, could either refer to an enum variant that's in scope, or bind a new variable. The compiler resolves this ambiguity by forbidding variab", "label": "medium", "label_id": 2} {"id": "rust_28217", "text": "thread 'rustc' panicked at 'index out of bounds: [...] src/libcollections/vec.rs:1047 | I can't use the `json!` macro on latest `master` (2015-09-03). **I tried this code:** src/main.rs ``` rust #![feature(plugin)] #![plugin(json_macros)] extern crate rustc_serialize; fn main() { let payload = json!({\"test\": \"1\"}); println!(payload.to_string()); } ``` Cargo.toml: `` | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28218", "text": "Backtraces never worked on `i686-pc-windows-gnu` | Backtraces on windows are generated using the `StackWalk64` function. This will generate incorrect backtraces if any of the frame pointers are omitted due to FPO. This would normally be fine, as debug builds are compiled without FPO enabled. However, even in debug builds, the cod | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_28219", "text": "Help text suggests the code that triggered the error | Got the following output when compiling: ``` src/lib.rs:41:32: 41:45 error: cannot infer an appropriate lifetime due to conflicting requirements src/lib.rs:41 guard.get(key).map(|v| BorrowedValue { guard: guard, value: v }) ^~~~~~~~~~~~~ src/lib.rs:40:5: 42:6 help: consider using | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28222", "text": "Cannot coerce to FnBox with references in arguments | It doesn't appear to be possible to return a FnBox which accepts references: ``` rust #![feature(fnbox)] use std::boxed::FnBox; type Callback = Box; fn get_cb() -> Callback { Box::new(|a, b| {}) } fn main() { } ``` produces the following error on `rustc | labels: A-type-system", "label": "medium", "label_id": 2} {"id": "rust_28224", "text": "Valgrind doesn't report allocations with jemalloc on nightly | Compiling the following code with `opt-level=0`, Valgrind reports 26 allocs for `rustc 1.2.0 (082e47636 2015-08-03)`, but 5 allocs for `rustc 1.4.0-nightly (cd138dc44 2015-09-02)`: ``` rust fn main() { let mut t = 0; for i in 0..10 { t += *Box::new(i); } assert_eq!(t, 45); } ``` | labels: P-medium, T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_28226", "text": "a way to compose functions | Here is a way (I was pointed to this by mbrubeck on the rust IRC channel) to [compose two functions](https://play.rust-lang.org/?code=%23!%5Bfeature%28unboxed_closures%2C%20core%29%5D%0A%0Afn%20succ%28x%3A%20i32%29%20-%3E%20i32%20%7B%20x%20%2B%201%20%7D%0Afn%20sq%28x%3A%20i32%29%", "label": "medium", "label_id": 2} {"id": "rust_28228", "text": "Add the release dates to RELEASES.md | Pages like Wikipedia/Wikidata need to prove that a given information is correct. The announcement blog posts seem to be the only obvious place to look up the the exact release dates. Blog post URLs are not necessarily stable over time. It would be simpler to just refer to RELEASE", "label": "medium", "label_id": 2} {"id": "rust_28229", "text": "functions implement Copy but not Clone | This compiles ``` rust fn func(){} fn main(){ run(func); run(func); } fn run(f: T) where T: Fn() + Copy{ f(); } ``` but this does not ([playground](http://is.gd/TidLCG)) ``` rust fn func(){} fn main(){ run(func); run(func); } fn run(f: T) where T: Fn() + Clone{ f(); } ``` T | labels: A-type-system, I-ICE, P-low, E-mentor, T-lang, T-compiler", "label": "high", "label_id": 1} {"id": "rust_28230", "text": "Rust panics if index out of bounds | ``` rust fn main () { let x = vec![1, 2, 3]; println!(\"Got: {}\", x[88]); } ``` This code compiles just fine, but, when I run it, I get an ICE, or something similar: ``` thread '
' panicked at 'index out of bounds: the len is 3 but the index is 88', ../src/libcollections/vec.", "label": "medium", "label_id": 2} {"id": "rust_28233", "text": "Enabling lto in 1.2.0 causes LLVM ERROR near llvm.lifetime.end | ``` % rustc -V rustc 1.2.0 (082e47636 2015-08-03) ``` ``` -C opt-level=3 -g -C debug-assertions=on ``` Disabling `lto` causes compilation to complete without issue. Enabling it causes errors as follow. Below are a few runs of `cargo build` followed by `cargo clean` between runs. | labels: A-LLVM, A-codegen", "label": "medium", "label_id": 2} {"id": "rust_28235", "text": "Tracking issue for overloaded `+=` operators (RFC 953) (feature augmented_assignments) | Tracking issue for RFC rust-lang/rfcs#953, which implements support for `+=` operators. cc @japaric | labels: T-lang, T-libs-api, B-unstable", "label": "question", "label_id": 4} {"id": "rust_28236", "text": "Tracking issue for raw fat pointer comparisons (RFC #1135) | Tracking issue for rust-lang/rfcs#1135, \"implement raw fat pointer comparisons\". cc @arielb1 | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_28237", "text": "Tracking issue for `..=` inclusive ranges (RFC #1192) -- originally `...` | ### Current status We are planning to to change the syntax for inclusive ranges and patterns to `..=`. The `...` syntax in patterns is stable and will remain (silently) deprecated for the time being; rustfmt can rewrite `...` to `..=`. This comes after much discussion. [See this | labels: E-mentor, T-lang, T-libs-api, B-unstable, B-RFC-implemented, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_28238", "text": "Tracking issue for constant prop not causing add'l errors (RFC #1229) | Tracking issue for rust-lang/rfcs#1229 cc @oli-obk | labels: A-lints, B-RFC-approved, T-lang, T-compiler, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_28239", "text": "Tracking issue for PhantomData being permitted by CoerceUnsize (RFC #1234) | Tracking issue for https://github.com/rust-lang/rfcs/pull/1234 cc @Gankro | labels: B-RFC-approved", "label": "medium", "label_id": 2} {"id": "rust_28243", "text": "Float repr fail in nested tuple access error message | This code ``` rust (1, (2, 3)).1.1 ``` produces this error message ``` expr.rs:5:14: 5:17 error: unexpected token: `1.1` expr.rs:5 {(1, (2, 3)).1.1} ^~~ expr.rs:5:14: 5:17 help: try parenthesizing the first index; e.g., `(foo.1).10000000000000009` ``` It should suggest `(foo.1).1", "label": "medium", "label_id": 2} {"id": "rust_28244", "text": "Open tracking issues for all language features | https://github.com/rust-lang/rust/issues/26868 but for lang features. The issues for each thing should be recorded in the corresponding place in `libsyntax/feature_gate.rs`, and when they've all been opened & recorded, the FIXME's relating to this issue in that file should be rem | labels: P-medium, T-lang", "label": "medium", "label_id": 2} {"id": "rust_28245", "text": "Introduction to Rust codebase | I want to contribute to Rust, but it is very hard to gain specific knowledge of the Rust codebase and how it works on my own. It is doable, by reading the source code and jumping-to-definition in Emacs, but is there any documentation generated for the source code, or something to", "label": "medium", "label_id": 2} {"id": "rust_28251", "text": "rustdoc fails to treat pipe character inside code blocks properly | Both of these examples should look like the original when rendered as a table in rustdoc but neither do. This: ``` //! Test | Table //! ------|------------- //! t = b | `x | y | z` ``` Results in: ``` //! Test | Table //! ------|------------- //! t = b | `x ``` This: ``` //! Test | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_28252", "text": "Rust book: Empty Markdown link | > “This works because Rust has a [hygienic macro system][].” I'll fix this as soon as I can get to it (tomorrow, because its nighttime here), but I thought I Should post an issue.", "label": "medium", "label_id": 2} {"id": "rust_28257", "text": "Tuple indexing should handle float tokens specially | `tuple.0.0` tokenises as [Ident(\"tuple\"), Dot, Float(\"0.0\")]. At present it produces an “unexpected token” error with a help message along the lines of “try parenthesizing the first index; e.g., `(tuple.0).0`”. This is silly. We should just special-case float literals of the form | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_28260", "text": "segfault while compiling stage2 libsyntax for i686-pc-windows-gnu | @alexcrichton has indicated this may be related to using newer versions of gcc, which might explain why it doesn't fail on the buildbot machines. The segfault occurs while running the `tailcallelim` llvm pass on `ast::Pat_::drop()`, possibly during the prerequisite `tti` analysis", "label": "medium", "label_id": 2} {"id": "rust_28261", "text": "ICE while compiling piston-gfx_texture | While compiling piston-gfx_texture v0.3.0 https://github.com/PistonDevelopers/gfx_texture/issues/67 ``` 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/r | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28262", "text": "\"make docs\" fails (1.2.0) | ``` root@deli:/home/borisov/src/rustc-1.2.0 # VERBOSE=1 make docs cfg: version 1.2.0-dev cfg: build triple x86_64-unknown-linux-gnu cfg: host triples x86_64-unknown-linux-gnu cfg: target triples x86_64-unknown-linux-gnu cfg: host for x86_64-unknown-linux-gnu is x86_64 cfg: os for", "label": "low", "label_id": 3} {"id": "rust_28267", "text": "ICE returning arrays with length specified by an associated constant | ### code ``` rust #![feature(associated_consts)] trait Trait { const SIZE: usize; } pub fn cause_compiler_to_panic() -> [u8; T::SIZE] { unimplemented!() } ``` ### compiler output ``` $ RUST_BACKTRACE=1 rustc --crate-type rlib compiler_panic.rs error: internal compiler e | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28271", "text": "Cannot implement trait for generic struct where types are also generic | In this example code, I want to implement the trait `Convert` for the struct `Combine` (which combines 2 Converts) ([code in playground](http://is.gd/656wnI)) ``` rust pub trait Convert{ fn convert(&self, data: D1) -> D2; } impl Convert for T where T: F", "label": "medium", "label_id": 2} {"id": "rust_28273", "text": "rustc_platform_intrinsics takes LLVM lots of time to compile | CPU: ``` model name : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz stepping : 3 microcode : 0x12 cpu MHz : 3392.293 cache size : 8192 KB ``` with debuginfo: ``` time: 0.580; rss: 228MB translation time: 0.228; rss: 172MB llvm function passes time: 48.802; rss: 287MB llvm module passes | labels: I-compiletime", "label": "medium", "label_id": 2} {"id": "rust_28279", "text": "Variance issue with higher kinded lifetimes | ``` rust fn test() -> *mut for<'a> Fn(&'a usize) { // change to *const and it'll work if let Some(_) = Some(1) { // not sure why I have to do this loop{} } else { loop{} } } fn main() {} ``` ``` :2:5: 6:6 error: cannot infer an appropriate lifetime for lifetime parameter 'a | labels: A-lifetimes", "label": "high", "label_id": 1} {"id": "rust_28284", "text": "Attributes on item macros are ignored | This compiles and runs without warnings: ``` rust macro_rules! m { () => ( fn f(){} ); } #[test] m!(); fn main() { f(); } ``` I at least expected the unused attribute lint to catch this", "label": "medium", "label_id": 2} {"id": "rust_28288", "text": "ICE: unprintable span | The following code: ``` Rust use nom::{IResult, not_line_ending, line_ending}; fn csv_line(input: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { terminated!(input, separated_list!(filter!(apply!(check_characters, b\"\\n\\r,\")), not_line_ending), line_ending) } fn check_characters(data: &[u8 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28290", "text": "ERROR:rbml::reader: failed to find block with tag 42 | It looks like this has been an issue in the past and there are some closed bugs that look similar, but it seems to have come back again... `rustc --version --verbose`: ``` rustc 1.4.0-nightly (f6aac8037 2015-09-06) binary: rustc commit-hash: f6aac80375ee8ec63522affc09e0cd5c4f888b", "label": "high", "label_id": 1} {"id": "rust_28293", "text": "Unexpected compiler error E0308 on arithmetic with borrowed values | I've faced with compiler error on arithmetic operations with borrowed values. After some simplification of my code, it was reduced to following program: ``` fn main() { let a: i32 = 0; let b: i32 = 0; let aa = &a; // works if b - aa < 0 { } // unexpected e0308 error if b < aa { } | labels: T-lang, T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_28296", "text": "Unused imports lint should detect redundant prelude imports | This code produces no warning: ``` rust use std::vec::Vec; fn main() { Vec::::new(); } ``` A warning would be useful for old code that imports items which have since made it into the prelude. | labels: C-enhancement, A-lints", "label": "low", "label_id": 3} {"id": "rust_28298", "text": "Improve Error Handling chapter | A long while back, @BurntSushi wrote http://blog.burntsushi.net/rust-error-handling/ . It is awesome, and deserves to be in the book in some form. Last we talked, @BurntSushi was okay with us using it from a licensing perspective.", "label": "medium", "label_id": 2} {"id": "rust_28302", "text": "Nightly documentation's std::vec's source link does not work | The `source` link on the `vec` page https://doc.rust-lang.org/nightly/std/vec/index.html leads to https://doc.rust-lang.org/nightly/core_collections/vec/?gotosrc=24157 which is just a `Not Found` page. I randomly clicked source on other pages and they seem to work. | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_28303", "text": "Documentation search finds std::rand::Rng::shuffle but does not find corresponding page | I search for `shuffle` in the documentation like so https://doc.rust-lang.org/stable/std/?search=shuffle . The result is `std::rand::Rng::shuffle - Shuffle a mutable slice in place.` but the link https://doc.rust-lang.org/stable/rand/trait.Rng.html#method.shuffle does not lead an | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_28308", "text": "ICE on assert!(\"test\") | While playing around on the playground, I found that this reports an ICE: ``` rust fn main() { assert!(\"test\"); } ``` ``` :2:4: 2:19 error: cannot apply unary operator `!` to type `&'static str` (internal compiler error: unprintable span) :1:1: 5:46 note: | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28309", "text": "Broken links in rustbook chapter on compiler plugins | This might be a known side-effect of the immature nature of compiler plugins, but nearly all of the links from the \"Compiler Plugins\" chapter are broken. https://doc.rust-lang.org/nightly/book/compiler-plugins.html Example from the 2nd paragraph: See the [rustc::plugin](https://d", "label": "low", "label_id": 3} {"id": "rust_28310", "text": "Weird dropping issues with transmute() and \"\" vs \"let _ = \" | ``` rust struct Dropper; impl Drop for Dropper { fn drop(&mut self) { println!(\"drop\"); } } fn main() { let d = Dropper; unsafe { std::mem::transmute::<_, u8>(d) }; } ``` this prints \"drop\". ``` rust struct Dropper; impl Drop for Dropper { fn drop(&mut self) { println!(\"drop\"); }", "label": "medium", "label_id": 2} {"id": "rust_28315", "text": "Constants behave differently depending on the way they're initialized. | I can't match using a constant that was initialized using a byte string literal: ``` const ARRAY1: [u8; 0] = []; const ARRAY2: [u8; 0] = *b\"\"; fn main() { match [] { ARRAY1 => {} ARRAY2 => {} } } ``` This gets an error: ``` a.rs:2:25: 2:29 error: constant evaluation error: unsupp", "label": "question", "label_id": 4} {"id": "rust_28317", "text": "Release versions of Rust need special flags to compile | Looks like distros need to build Rust with some specific flags to get them work as expected. This can be problematic for packagers and users of non-official-builds of Rust, so I think that this must be clearly described somewhere. Another option would be to just set those options", "label": "medium", "label_id": 2} {"id": "rust_28320", "text": "Shadowed enum variants lead to badness | This is crate `c`: ``` rust pub enum E { V(u8) } impl E { fn V(u: u8) -> E { println!(\"IN V!\"); E::V(u) } pub fn test(&self) { match *self { E::V(val) => println!(\"{}\", val), } } } ``` This compiles fine. The `E::V(u)` line seems to use the variant constructor instead of my funct", "label": "medium", "label_id": 2} {"id": "rust_28322", "text": "Use --release-channel=stable by default on releases | Release tarballs should be compilable with just basic `./configure ; make ; sudo make install` without having to pass special flags to configure. This is the case of the `--release-channel` option, that must be changed in the releases.", "label": "medium", "label_id": 2} {"id": "rust_28324", "text": "dereferences in statics can create broken code | ## STR ``` Rust extern { static error_message_count: u32; // anything will do } pub static BAZ: u32 = *&error_message_count; fn main() {} ``` ## | labels: A-LLVM, I-ICE, E-needs-test", "label": "high", "label_id": 1} {"id": "rust_28325", "text": "Rules governing references to private types in public APIs not enforced in impls | This code compiles, it should not: ``` rust mod x { pub struct Foo { x: u32 } struct Bar { x: u32 } impl Foo { pub fn foo(&self, x: Self, y: Bar) { } } } fn main() { } ``` cc @nrc | labels: P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_28326", "text": "Remove the unnecessary lang items for Send and Sync | I remember @huonw telling me long ago that these lang items are unnecessary, though I don't remember if there's a good reason for why they haven't been removed yet. | labels: C-cleanup, T-lang, T-compiler", "label": "low", "label_id": 3} {"id": "rust_28330", "text": "internal compiler error on 1.4.0-dev for i686-pc-windows-gnu | I tried the cross-compilation for windows following procedures on this page. [Using Rust in Wine as a sort of cross-compiler](https://gist.github.com/vi/883cacf09b57a8efe5bf) In procedure No.3, I got an internal compiler error, like that. ``` bash $ RUST_BACKTRACE=1 /opt/local/bi", "label": "high", "label_id": 1} {"id": "rust_28334", "text": "Cannot call static function of type in macro | The following code fails to compile: ``` macro_rules! macro_ { ($t:ty) => { impl $t { fn bar() -> $t { unimplemented!(); } fn foo() -> $t { $t::bar(); } } } } struct Foo; macro_!(Foo); ``` Error message: ``` a.rs:8:17: 8:19 error: unexpected token: `Foo` a.rs:8 $t::bar(); ^~ ``` ", "label": "medium", "label_id": 2} {"id": "rust_28335", "text": "Cannot hygienically create test functions in macro | Code: ``` macro_rules! macro_ { ($t:ty) => { #[test] fn test() { } } } struct Foo; struct Bar; macro_!(Foo); macro_!(Bar); ``` Error: ``` a.rs:4:9: 4:22 error: duplicate definition of value `test` [E0428] a.rs:4 fn test() { } ^~~~~~~~~~~~~ a.rs:1:1: 6:2 note: in expansion of macr | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28342", "text": "Linker failure while compiling exa with LTO (duplicate symbols) | Building [exa](https://github.com/ogham/exa) fails at link stage if LTO is used and system package for libssh2-dev is not installed: ``` Compiling exa v0.3.0 (file:///home/butler/packs/exa) error: linking with `cc` failed: exit code: 1 note: \"cc\" \"-Wl,--as-needed\" \"-m64\" \"-L\" \"/h", "label": "medium", "label_id": 2} {"id": "rust_28343", "text": "rustc panics with index out of bounds | Sample code in question: ``` rust struct MyStruct { x: i32, } fn foo(v: &Vec, s: &MyStruct) { } fn main() { let v1 = vec![]; let v2 = vec![]; foo(&v1, &v2); } ``` rustc correctly complains about the type of the second argument in the call to foo(), but then panics. Backtrace | labels: I-ICE", "label": "question", "label_id": 4} {"id": "rust_28344", "text": "Type parameter `Self/SelfSpace.0` (Self/SelfSpace/0) out of range when substituting | Hello! I'm reporting an apparent compiler error stemming from a typo. **Version** ``` sh $ rustc --version --verbose rustc 1.4.0-nightly (7bf626a68 2015-09-07) binary: rustc commit-hash: 7bf626a68045be1d1a4fac9a635113bb7775b6bb commit-date: 2015-09-07 host: x86_64-apple-darwin re", "label": "high", "label_id": 1} {"id": "rust_28347", "text": "ICE: the 1th autoderef failed | ICE when using `Rc>>.` ``` rust use std::rc::Rc; use std::cell::RefCell; fn main() { let mut a = 0; let fs = vec![Rc::new(RefCell::new(Box::new(|| a = 4 )))]; fs.iter().map(|f| { let mut closure = f.borrow_mut(); (&mut *closure)() }); } ``` `rustc --version - | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28352", "text": "Error explanation suggests using #![no_std] when already in use | I've been running into a linker error `undefined reference to 'panicking::panic::h98aad983367da335F7E'` while trying to build with `#![no_std]`. While trying to debug, I ended up with some code that looked like this: https://gist.github.com/anonymous/88c01ee6ee33e4bad656 When you | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28356", "text": "Tracking issue for Arc/Rc extras | This is a tracking issue for the `arc_counts`, `rc_counts`, and `rc_would_unwrap` features. The counting functions have been around for awhile but `would_unwrap` was added recently. cc #27718, more discussion there. | labels: T-libs-api, final-comment-period, B-unstable", "label": "question", "label_id": 4} {"id": "rust_28359", "text": "Improve [..] and as_slice documentation | The section of the Rust book on Slices is nice (hard to find in primitive types) but it gives more information on [..](and it's origins in [1..] and [3..5] [..3] type indexing): https://github.com/rust-lang/rust/blob/master/src/doc/trpl/primitive-types.md#slices The actual docs f", "label": "low", "label_id": 3} {"id": "rust_28360", "text": "rustdoc generates `where` clauses that are not valid Rust | At the moment, the summary for the IntoIterator trait definition reads: ``` pub trait IntoIterator where Self::IntoIter::Item == Self::Item { type Item; type IntoIter: Iterator; fn into_iter(self) -> Self::IntoIter; } ``` The 'where' clause on the first line isn't valid Rust, whi | labels: T-rustdoc, T-dev-tools, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28361", "text": "Calling a block: discrepancy between parser-lalr and rustc | I don't know whether this code is valid syntax: ``` rust fn f(i: i32) -> i32 { i } fn main() { 1 + {f}(1); } ``` It is rejected by `rustc`: ``` test.rs:3:12: 3:13 error: expected one of `.`, `;`, `}`, or an operator, found `(` test.rs:3 1 + {f}(1); ^ ``` It is _accepted_ by the L | labels: A-grammar, T-lang, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28362", "text": "Field access of cast expression: discrepancy between parser-lalr and rustc | It's not clear to me whether this code is valid syntax. It looks wrong, so maybe it ought to be rejected. `rustc` rejects it, but `parser-lalr` accepts it: ``` rust struct S { f: i32 } fn main() { let s = S { f: 42 }; s as S.f; } ``` It _looks_ like it should parse as `s as (S.f) | labels: A-grammar, P-medium, T-lang, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28363", "text": "HRTB aren't described in the book | https://github.com/rust-lang/rfcs/blob/master/text/0387-higher-ranked-trait-bounds.md This is, as far as I know, the only thing syntax-wise that's not covered at all.", "label": "medium", "label_id": 2} {"id": "rust_28365", "text": "Compiler for piston-gfx_texture v0.3.0 | rustc 1.4.0-nightly (7780408af 2015-09-01) ``` Compiling piston-gfx_texture v0.3.0 Running `rustc /home/alex/.cargo/registry/src/github.com-0a35038f75765ae4/piston-gfx_texture-0.3.0/src/lib.rs --crate-name gfx_texture --crate-type lib -C opt-level=3 -C metadata=9792eb950b42c997 -", "label": "high", "label_id": 1} {"id": "rust_28367", "text": "List of commands and formats for the rustc testing setup? | I'm trying to come up with some official documentation for the way we test the rust compiler. So far, I know of: - `~^`, `~^^`, and `~|` - `HELP`, `ERROR` I'm a bit foggy on how the error text actually works too. If anyone has anything to add to this, or any information about thi", "label": "medium", "label_id": 2} {"id": "rust_28373", "text": "Somehow address redundancies between doc-comment code and crate code | # Issue I noticed with a few of my crates that I have some redundancies between my docs and the code in the crate, specifically testcases. As a example, here `nice_example()` is duplicated: `````` //! docs docs docs //! docs docs docs //! ``` //! fn nice_example() { ... } //! ``` | labels: T-rustdoc, T-dev-tools, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_28374", "text": "SipHasher::write, when used externally, should refer to trait method, not inherent (and private) method. | This code snippet works: http://is.gd/cAKwYz However, substituting `::Hasher` for `::SipHasher` gives the following error: ``` src/chunks.rs:35:5: 35:34 error: method `write` is private src/chunks.rs:35 ::std::hash::SipHasher::write(&mut hasher, &x); ``` Discussion from IRC: ``` ", "label": "question", "label_id": 4} {"id": "rust_28377", "text": "ICE: assertion failed: bound_list_is_sorted(&bounds.projection_bounds) | When trying to compile a crate using `cargo build`, `rustc` fails with an unexpected panic. Cargo prints this message: ``` bash $ cargo build Compiling mnemosyne-parser v0.1.0 (file:///Users/hawk/Development/mnemosyne) error: internal compiler error: unexpected panic note: the co | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28378", "text": "type cannot be shared between threads safely message could be more informative | If you hit an issue such as ``` misc.rs:26:5: 26:17 error: the trait `core::marker::Sync` is not implemented for the type `*mut libc::types::common::c95::c_void` [E0277] misc.rs:26 require_sync(&x); ^~~~~~~~~~~~ misc.rs:26:5: 26:17 help: run `rustc --explain E0277` to see a detai | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28379", "text": "Field access of block: discrepancy between parser-lalr and rustc | ``` rust struct S { f: u32 } fn main() { { S { f: 42 } }.f; // rustc accepts, parser-lalr rejects { 42 } as i32; // rustc and parser-lalr reject { 42 } == 42; // rustc and parser-lalr reject } ``` The grammar in src/grammar/parser-lalr.y should probably be relaxed to accept the f | labels: A-grammar, P-medium, I-needs-decision, T-lang, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28380", "text": "Information about @bors | I'm planning to write a short manual for bors, so anyone who has any information about how bors works, please post here.", "label": "medium", "label_id": 2} {"id": "rust_28382", "text": "Float to integer casts can have undefined results | By accident I came across an ICE from this code: `(-1.0 as usize,)`. The ICE is triggered by an assertion while building the constant tuple. The field has a value of `undef`. Looking into it, the two floating point to integer cast instructions, `fptoui` and `fptosi` have a very l", "label": "medium", "label_id": 2} {"id": "rust_28384", "text": "Panic condition documentation consistency | I noticed that the formatting of panic conditions in the documentation of a lot of functions seems to be inconsistent. Specifically it varies between simple warnings in the description of the function and 'Panics' subheaders with the panic condition listed below. A good example b", "label": "medium", "label_id": 2} {"id": "rust_28385", "text": "Terminal. | I use a terminal with a black background. When I try to compile rust code, and errors or warnings occur, I don't see the messages (but the colored 'error' or 'warning'). That is because the messages are always black, is there any way I can change that? :art:", "label": "medium", "label_id": 2} {"id": "rust_28387", "text": "Unwinding in a drop() implementation skips remaining drops | Given this: ``` rust struct S; impl Drop for S { fn drop(&mut self) { println!(\"Dropping S\"); panic!(\"DIE\"); } } struct T; impl Drop for T { fn drop(&mut self) { println!(\"Dropping T\"); } } fn main() { let t = T; let s = S; } ``` The output is: ``` Dropping S thread '
' pani", "label": "medium", "label_id": 2} {"id": "rust_28388", "text": "Privacy, stability etc. are not respected in imports with empty braces | ``` use std::rt::{}; ``` should warn that `std::rt` is unstable, but it doesn't. ``` mod m { mod n {} } use m::n::{}; ``` should be caught by privacy checker, but it isn't. See https://github.com/rust-lang/rust/pull/28364#issuecomment-139869943 for some details.", "label": "medium", "label_id": 2} {"id": "rust_28394", "text": "Invalid \"error: source trait is inaccessible\" error | This code __does not__ compile ([playpen](http://is.gd/uKBOfD)): ``` rust pub mod mymod{ mod foo { pub trait ToFoo{ fn to_foo(self) -> i32; } } pub use self::foo::ToFoo; } pub fn foobar(x: T) { let v = x.to_foo(); } fn main() {} ``` Output: ``` :14:13: 14:2", "label": "medium", "label_id": 2} {"id": "rust_28397", "text": "Internal compiler error involving boxing a closure... | ``` damien@fx-8150 ~/Documents/mkt $ cargo build Compiling mkt v0.1.0 (file:///home/damien/Documents/mkt) error: internal compiler error: no type for node 1423: local stock (id=1423) in fcx 0x7ff9de3f1358 note: the compiler unexpectedly panicked. this is a bug. note: we would app | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28398", "text": "Placing constant expressions in statics can result in unnecessary huge memcpy's | ``` rust pub enum MyEnum { A(u32), B([u8; 65536]), } pub fn slow(e: &mut MyEnum) { *e = MyEnum::A(32); } pub fn fast(e: &mut MyEnum, x: u32) { *e = MyEnum::A(x); } ``` The optimised IR is: ``` llvm ; ModuleID = 'rust_out.0.rs' target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:1 | labels: I-slow, A-codegen, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_28402", "text": "Poor error message with assigning invalid constant to enum variant | ``` Rust pub struct Foo(pub u32); pub const CONSTANT: Foo = Foo(1); #[derive(Clone)] enum Enum { Variant = CONSTANT, } fn main() {} ``` ``` :2:27: 2:33 error: constant evaluation error: unsupported constant expr [E0080] :2 pub const CONSTANT: Foo = Foo(1); ^~~~~~ extern crate x86; use core::{ptr, intrinsics}; use self::x86::io::{inb, outb}; /***** Serial I/O code *****/ const COM1: u16 = 0x3f8; const COM_RX: u16 = 0; // In: Receive buffer (DLAB=0) const COM_TX: | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28412", "text": "Broken anchor links in new Error Handling guide | In the [Error Handling guide](https://doc.rust-lang.org/nightly/book/error-handling.html), clicking the anchor link \"A brief interlude: unwrapping isn't evil\" in the table of contents has no effect. It points to: https://doc.rust-lang.org/nightly/book/error-handling.html#a-brief-", "label": "medium", "label_id": 2} {"id": "rust_28415", "text": "macro_rules attempts to expand tokens it needs to only pass through. | ``` rust macro_rules! expr { ($a:expr) => ($a) } macro_rules! str_tts { ($b:tt) => { expr!(stringify!($b)) } } fn main () { // This works (\"$ c\"). let x = expr!(stringify!($c)); // This errors with \"unknown macro variable `c`\". let y = str_tts!($c); println!(\"{} {}\", x, y); } ``` | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28416", "text": "Error in iterator filter predicate results in an unhelpfully exponential number of error messages | ``` fn main() { let buf: &[u8] = &[12, 13, 14, 15, 16]; let indices = buf.iter().zip(buf.iter().skip(1)).enumerate().filter(|_, (a, b)| *a == b'\\r' && *b == b'\\n').map(|(i, (_, _))| i); for i in indices { // ... } } ``` Building the above produces 48 errors. Removing the map at t | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28418", "text": "Missing code snippet in the Error Handling guide | Paragraph 6 of https://doc.rust-lang.org/nightly/book/error-handling.html#the-option-type starts with : \"But wait, what about unwrap used in unwrap-double?\". The problem is that there is no code sample involving something called `unwrap-double`. It seems that there is some piece ", "label": "medium", "label_id": 2} {"id": "rust_28419", "text": "improve error message when resolution via Deref actually required DerefMut | If a type `B` implements `Deref` to get out `&A`, then auto-deref based method resolution of instances of `B` will include methods of `A` that require `&mut self`, even when there is no `DerefMut` that would be necessary for such auto-deref to work. We still reject the code, with | labels: C-enhancement, A-diagnostics, E-mentor, WG-diagnostics", "label": "low", "label_id": 3} {"id": "rust_28424", "text": "Macro items assigned bad span | Item-like macro invocations are assigned a bad span. Oft-times it'll only contains a semicolon. | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28431", "text": "Overcomplicated sample code for Option::iter_mut and Result::iter_mut | The code samples that illustrate the [Option::iter_mut()](https://doc.rust-lang.org/nightly/core/option/enum.Option.html#method.iter_mut) and [Result::iter_mut()](https://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.iter_mut) use an overcomplicated pattern. For i", "label": "medium", "label_id": 2} {"id": "rust_28433", "text": "visibility modifiers are accepted for enum variants | The following code compiles without warnings: ``` rust #[allow(dead_code)] enum Foo { pub Spam, Eggs } fn main() { } ``` I guess that this should be forbidden, because enum vairants inherit visibility of the enum itself. At minimum, this should produce a warning. This is the rele", "label": "question", "label_id": 4} {"id": "rust_28434", "text": "Using a plugin that was built without `-C prefer-dynamic` causes LLVM error | I forgot to add `plugin = true` to Cargo.toml and got this when building an external test: ``` : CommandLine Error: Option 'interpreter-print-volatile' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options ``` For reference, this is an incorrect w | labels: A-frontend, A-LLVM, I-ICE, C-bug", "label": "high", "label_id": 1} {"id": "rust_28439", "text": "Parser does not stop early enough if keyword is found instead of ident | For ``` rust enum A { enum A } ``` and for ``` rust struct A { mod A } ``` 2 errors are emitted for each ``` test.rs:2:5: 2:9 error: expected identifier, found keyword `enum` test.rs:2 enum A ^~~~ test.rs:2:10: 2:11 error: expected one of `(`, `,`, `=`, `{`, or `}`, found `A` tes", "label": "medium", "label_id": 2} {"id": "rust_28445", "text": "Build with --enable-llvm-assertions segfaults on Windows (MinGW 64) | The issue is Windows-specific, I can't reproduce it on Kubuntu. cc @alexcrichton (?) based on the backtrace and git blame Configure: ``` ./configure --enable-llvm-assertions ``` Build: ``` $ make VERBOSE=1 cfg: version 1.5.0-dev (355daea40 2015-09-16) cfg: build triple x86_64-pc- | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_28446", "text": "Crates failing on beta | This has been reported multiple times: https://travis-ci.org/serde-rs/json/jobs/80688459 The new beta is mysteriously failing. Looks cargo-related. Need to fix this asap. cc @alexcrichton @rust-lang/tools | labels: regression-from-stable-to-nightly", "label": "critical_bug", "label_id": 0} {"id": "rust_28447", "text": "Tests run-pass/backtrace.rs and run-pass/backtrace-debuginfo.rs fail on Windows (MinGW 64) | cc @Diggsey Configure: ``` ./configure ``` Build: ``` $ make check-notidy TESTNAME=backtrace.rs cfg: version 1.5.0-dev (355daea40 2015-09-16) cfg: build triple x86_64-pc-windows-gnu cfg: host triples x86_64-pc-windows-gnu cfg: target triples x86_64-pc-windows-gnu cfg: host for x8 | labels: O-windows, O-windows-gnu", "label": "medium", "label_id": 2} {"id": "rust_28448", "text": "Always pass /DEBUG to msvc linker | From convo with @retep998, passing /DEBUG, even w/o emitting debuginfo, makes backtraces work. They 'see no reason' not to always pass this flag. This should be a simple change to `rustc::back::link`. | labels: E-easy, A-linkage", "label": "low", "label_id": 3} {"id": "rust_28449", "text": "Mutable borrows in an `else if` after an `if let` are disallowed | ``` rust fn main() { let mut f = Some(1); if let Some(a) = f { } else if f.as_mut().is_some() {} } ``` Gives: ``` :4:15: 4:16 error: cannot mutably borrow in a pattern guard [E0301] :4 } else if f.as_mut().is_some() {} ^ note: in expansion of if let expansion :3", "label": "medium", "label_id": 2} {"id": "rust_28450", "text": "Type alias can be used to bypass privacy check | ``` rust struct Priv; pub use self::private::public; mod private { pub type Priv = super::Priv; pub fn public(_x: Priv) { } } ``` The function `public` is exported, accepting the type `Priv`, even though `Priv` is not exported. | labels: P-high, T-lang", "label": "high", "label_id": 1} {"id": "rust_28456", "text": "Meaningless `pub` lint. | I would expect a lint warning about `pub` declarations which aren't needed or meaningful. ``` rust mod a { struct A; impl A { pub fn x() { } } } ``` This simple example would warn about a meaningless `pub` for the function `x`. | labels: A-lints", "label": "medium", "label_id": 2} {"id": "rust_28458", "text": "Ambiguous explanation of Sync in the book | > When a type `T` implements `Sync`, it indicates to the compiler that something of this type has no possibility of introducing memory unsafety when used from multiple threads concurrently. The term \"used\" should be elaborated: \"when used by immutable reference from ...\" It will ", "label": "medium", "label_id": 2} {"id": "rust_28460", "text": "trpl: Off-by-one highest memory address | The highest memory address used in the example of `the-stack-and-the-heap.md` should be `2^30 - 1`, not `2^30`.", "label": "medium", "label_id": 2} {"id": "rust_28461", "text": "trpl: Invalid byte size terminology | The following terms are used in `the-stack-and-the-heap.md`: _gigabyte_, _GB_. But a gigabyte is 10^9 bytes, not 2^30. The correct terms are: _gibibyte_, _GiB_.", "label": "medium", "label_id": 2} {"id": "rust_28467", "text": "Bootstrap rust for ARM64 | I am trying to bootstrap rust for ARM64. I am trying to build an arm64 stage0 rustc on an x86 machine so that I can use that to natively compile rustc on ARM64. I have the aarch64-linux-gnu-gcc cross compiler installed. I am configuring rust as follows: ``` $ ../configure --host=", "label": "medium", "label_id": 2} {"id": "rust_28472", "text": "Bad span for public foreign function | The pub keyword isn't included in the span. See [this example in the rust playground](https://play.rust-lang.org/?code=extern%20{%0A%20%20pub%20fn%20foxxxo%28%29%3B%0A%20%20pub%20fn%20foxxxo%28%29%3B%0A}%0A%0Apub%20fn%20foyyyo%28%29%20{}%0Apub%20fn%20foyyyo%28%29%20{}%0A%0Afn%20m", "label": "medium", "label_id": 2} {"id": "rust_28475", "text": "Negative blanket OIBIT impl treated as positive | `impl !Pod for .. {}` looks like it produces a positive impl. [(playpen)](https://play.rust-lang.org/?gist=6b188c2bb938c1d831fc&version=nightly) ``` rust #![feature(optin_builtin_traits)] unsafe trait Pod {} unsafe impl !Pod for .. {} struct Foo(X, Y); fn is_pod(_: | labels: A-type-system, P-medium, T-lang, C-bug", "label": "medium", "label_id": 2} {"id": "rust_28477", "text": "match statements that cover all possible values for type not seen as exhaustive | Apologies if this is a dupe. This doesn't compile: ``` rust fn main() { match 25u8 { 0 ... 24 => println!(\"less than 25\"), 25 => println!(\"exactly 25\"), 26 ... 255 => println!(\"above 25\") } } ``` Error message: ``` :2:5: 6:6 error: non-exhaustive patterns: `_` not covered [ | labels: T-lang", "label": "question", "label_id": 4} {"id": "rust_28478", "text": "rustdoc generates bad fragments in links to trait methods | For example, https://doc.rust-lang.org/nightly/std/net/enum.SocketAddr.html links to \"https://doc.rust-lang.org/nightly/std/fmt/trait.Display.html#method.fmt\", but the correct link is \"https://doc.rust-lang.org/nightly/std/fmt/trait.Display.html#tymethod.fmt\". | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_28479", "text": "rustdoc generates duplicate anchors | For https://doc.rust-lang.org/nightly/std/collections/struct.HashMap.html : | Anchor | Lines | | --- | --- | | method.extend | 740, 741 | | assoc_type.IntoIter | 731, 734, 737 | | assoc_type.Item | 730, 733, 736 | | method.into_iter | 732, 735, 738 | | examples | 85, 218, 229, 24", "label": "medium", "label_id": 2} {"id": "rust_28480", "text": "rustdoc generates cross-crate links to pages which don't exist because of #[doc(hidden)] | For example, https://doc.rust-lang.org/nightly/std/fmt/struct.Formatter.html#method.align links to https://doc.rust-lang.org/nightly/core/fmt/rt/v1/enum.Alignment.html, which doesn't exist because std::fmt::rt is marked #[doc(hidden)] . | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_28481", "text": "clone_from in the standard library | The `Clone` trait has a sadly-neglected `clone_from` method that clones a value into an existing one. There is a default implementation, but it's fairly naive and therefore not optimal for all cases, notably collections. It would be good if the major collections had better implem | labels: I-slow, C-enhancement, T-libs-api, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_28482", "text": "Emitted LLVM-IR should be annotated to connect to rs source | I've tried looking at llvm-ir output to understand how my code is translated by rustc, but this is currently very difficult. Can be by line numbers, or include original source in an llvm-ir comment. For those llvm-ir assignments that correspond to rust variable assignments, givin | labels: A-LLVM, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_28487", "text": "Poor diagnostics on implicitly required `Sized` bound for all type parameters | [This](https://play.rust-lang.org/?gist=5563b832a31eefd08109&version=nightly): ``` fn main() {} struct A { a: T::S } trait B { type S; fn s(&self) -> Self::S; fn res(&self) -> A { A { a: self.s() } } } ``` errors out with: ``` :11:9: 11:10 error: the trait `core | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28488", "text": "`VecDeque::push_back(())` does not work correctly. | http://is.gd/NY4tCl ``` use std::collections::VecDeque; fn main() { let mut v = VecDeque::new(); v.push_back(()); assert!(v.len() > 0 ); } thread '
' panicked at 'assertion failed: v.len() > 0', :6 ``` | labels: regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_28490", "text": "E0015 \"function calls in statics\" recommends using constant functions in stable even though constant functions are not stable | Using rustc 1.3.0 (9a92aaf19 2015-09-15) ``` rust struct Foo { a: u8 } fn bar() -> Foo { Foo { a: 5 } } static foo: Foo = bar(); fn main() {} ``` ``` > rustc test.rs test.rs:6:19: 6:24 error: function calls in statics are limited to constant functions, struct and enum constructor | labels: A-diagnostics", "label": "question", "label_id": 4} {"id": "rust_28493", "text": "`BTreeSet` causes general protection fault with zero-sized key-value pairs and jemalloc | foo.rs: ``` rust use std::collections::BTreeSet; fn main() { let _: BTreeSet<()> = BTreeSet::new(); } ``` Output: ``` sh > rustc --version rustc 1.5.0-nightly (cff041170 2015-09-17) > rustc foo.rs > valgrind ./foo ==15717== Memcheck, a memory error detector ==15717== Copyright (C | labels: A-collections, T-libs-api", "label": "high", "label_id": 1} {"id": "rust_28502", "text": "LLVM assertion hit while building SpiderMonkey bindings | I have some code at https://gist.github.com/michaelwu/1040fa8f592ad020f893 . Building it with the latest nightly using `rustc --crate-type lib jsapi.rs` results in this assertion `Assertion failed: (getOperand(0)->getType() == cast(getOperand(1)->getType())->getEleme | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28508", "text": "source tarball contains snapshot.pyc | This generated file should not be distributed. [Link](https://internals.rust-lang.org/t/perfecting-rust-packaging/2623/18?u=brson) Look near the `tar-dist-src` rule in the makefiles to fix. | labels: E-easy", "label": "low", "label_id": 3} {"id": "rust_28509", "text": "LLVM contains non-DSFG-compatible file | Per @anguslees, the file src/llvm/cmake/modules/LLVMParseArguments.cmake carries the CC-BY _2.5_ license (an old version of the license), which is [not compatible with the Debian Free Software Guidelines](https://wiki.debian.org/DFSGLicenses). We are distributing this file in our", "label": "medium", "label_id": 2} {"id": "rust_28510", "text": "The docs for print! and println! should contain panics section | Invocations of the `print!(..)` and `println!(..)` macros may panic if stdout isn't writeable. This is undocumented as of yet. Proposed solution: Add a `# Panics` section in both doc comments.", "label": "low", "label_id": 3} {"id": "rust_28513", "text": "transmute_copy doc is backward. | The doc for [`mem::transmute_copy`](https://github.com/rust-lang/rust/blob/master/src/libcore/mem.rs#L532) states ... > Interprets `src` as `&U`, and then reads `src` without moving the contained value. ... but the function is built around [`ptr::read`](https://github.com/rust-la", "label": "medium", "label_id": 2} {"id": "rust_28514", "text": "Private trait's methods reachable through a public subtrait | I'm not 100% sure how the privacy rules should work. A's methods should not be callable because the trait is private, but it's reachable though the trait C that inherits A, by calling `C::a()`. B's methods are reachable the same way, even if it's marked pub but not publically rea | labels: A-resolve, A-visibility, T-lang", "label": "medium", "label_id": 2} {"id": "rust_28517", "text": "RangeArgument not exported to std::collections | Trait RangeArgument (currently new and unstable in Rust 1.3) is not exported into standard library. https://doc.rust-lang.org/stable/collections/range/trait.RangeArgument.html", "label": "medium", "label_id": 2} {"id": "rust_28518", "text": "Test that all collections work with zero-sized types (ZST) | In light of #28488, add tests to the testsuite that exercise all collections using ZST. Most common ZST is the `()` (empty tuple), and all collections need to support it. | labels: E-easy, A-collections", "label": "question", "label_id": 4} {"id": "rust_28520", "text": "Module inner spans run a bit long | Consider this code: ``` mod foo { mod bar { mod baz {} } } ``` The inner spans, innermost to outermost: `}`, `mod baz {} }`, `mod bar { mod baz {} } }\\n\\n`. The docs state that the inner should be [a] span from the first token past `{` to the last token until `}`.", "label": "low", "label_id": 3} {"id": "rust_28523", "text": "unhelpful error message invoking fn foo() when T is not used within signature | Test case: ``` rust fn foo() {} fn main() { foo() } ``` Error: ``` t.rs:2:13: 2:16 error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282] t.rs:2 fn main() { foo() } ^~~ ``` It should, at least, mention `T` by na", "label": "medium", "label_id": 2} {"id": "rust_28524", "text": "Re-exported functions aren't being resolved when used from other modules. | I did most of my development for a project on the 1.4-nightly branch of the compiler, but when running travis.ci (1.3-stable), I got really weird import resolution errors. [errors here](https://travis-ci.org/TyOverby/ares/builds/81212781) - [source code here](https://github.com/T", "label": "medium", "label_id": 2} {"id": "rust_28527", "text": "Replace the ast::Mac_ enum with a struct | https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs#L1137 ``` rust pub enum Mac_ { MacInvocTT(Path, Vec, SyntaxContext), // new macro-invocation } ``` this should instead be something like ``` rust pub struct MacroInvoke { path: Path, tts: Vec | labels: E-easy, E-mentor", "label": "low", "label_id": 3} {"id": "rust_28528", "text": "read_link cannot open some files reported as symbolic links on windows | rustc on Windows 7 32 bit: ``` C:\\Users\\andrew\\walkdir\\symlinks>rustc --version rustc 1.5.0-nightly (6e5a32547 2015-09-19) ``` Test program: ``` rust use std::fs; fn main() { let md = fs::symlink_metadata(\"is_a_symlink\").unwrap(); println!(\"is symlink? {}\", md.file_type().is_syml | labels: O-windows", "label": "medium", "label_id": 2} {"id": "rust_28530", "text": "Give windows-gnu-specific issues a tag separate from A-windows | I propose that A-windows be used for any issue that affects -msvc targets, but not for any issue that doesn't affect -msvc targets. In particular, if an issue is msys-specific then it shouldn't be given the A-windows tag, but instead a different one like A-Windows-gnu. In theory | labels: O-windows, O-windows-gnu, O-windows-msvc", "label": "question", "label_id": 4} {"id": "rust_28533", "text": "Creating data-less enum variant with data yields a confusing error message | ``` rust enum Test { Variant, Variant2(&'static str) } fn main(){ let y = Test::Variant2(\"Hello\"); let x = Test::Variant(\"World\"); } ``` results in ``` :8:13: 8:35 error: expected function, found `Test` :8 let x = Test::Variant(\"World\"); ^~~~~~~~~~~~~~~~~~~~~~ ``` The | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28536", "text": "Moving out of boxed structs by destructuring no longer works | In 1.3.0, ``` struct PatriciaTree { data: Box, child_l: Box, } impl PatriciaTree { fn delete(&mut self) { let child = Box::new(PatriciaTree { data: Box::new(5), child_l: Box::new(5) }); let PatriciaTree { data, child_l } = *child; } } fn main() {} ``` fails with ``` break", "label": "medium", "label_id": 2} {"id": "rust_28537", "text": "Rustdoc handling of public re-export is broken | Looking at nightly docs of `core::num`, the presentation of `ParseFloatError` is confusing. It looks like this: ![rustdoc](https://cloud.githubusercontent.com/assets/2311707/9981695/622813d4-5fc4-11e5-9734-5884e190c801.PNG) It should be rendered like `ParseIntError`, for example. | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_28540", "text": "Compiler panic while compiling | Compiler paniced when \"cargo test\" was executed git snap shot of file https://github.com/valarauca/Fact/tree/1cfcdbb41e2099abefcea7994bd03b48aa2be882 | labels: I-ICE", "label": "high", "label_id": 1} {"id": "rust_28542", "text": "Compiler crash while linking lambdas across crates | Source code that causes crash https://github.com/valarauca/Block/tree/CompilerCrash Has own dedicated branch. Readme.md includes git check out of extern crate which was loaded. Occurs in Rustc v1.3 x86_64 Linux v3.19.3 Also Occurs in Rustc v1.2 x86_64 rustc 1.4.0-beta.1 (d2e13e82", "label": "medium", "label_id": 2} {"id": "rust_28544", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28545", "text": "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?", "label": "low", "label_id": 3} {"id": "rust_28546", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28547", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28549", "text": "There should be an `impl AsMut<[T]> for Vec`. | In [GJ](https://github.com/dwrensha/gj) I have this trait like this: ``` pub trait AsyncRead: 'static { fn try_read(self, buf: T, min_bytes: usize) -> Promise<(Self, T, usize), Error<(Self, T)>> where T: DerefMut, Self: Sized; } ``` I'd like to switch the bound on", "label": "medium", "label_id": 2} {"id": "rust_28550", "text": "ICE: unexpected panic in InferCtxt | Compiling the following code causes a panic: ``` rust use std::result::Result; use std::thread; struct A { t: H::Timeout, } trait B { type Timeout; } struct C where F: Factory { f: F, } impl B for C where F: Factory { type Timeout = (); } struct D where F: Fact | labels: I-ICE, P-medium, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_28551", "text": "[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", "label": "medium", "label_id": 2} {"id": "rust_28553", "text": "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<", "label": "medium", "label_id": 2} {"id": "rust_28556", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28557", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28558", "text": "Macro invocations allow type parameters in the path | `vec::>![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", "label": "medium", "label_id": 2} {"id": "rust_28559", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28561", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28568", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28570", "text": "rust warns about unused assignment erroneously | Like in the program below - ``` fn f() -> Option { None } fn main() { let mut v = 5; while v != 4 { let _ = match f() { Some(x) => x, None => { v = 4; continue }, }; v = 2; } } :11:17: 11:18 warning: value assigned to `v` is never read, #[warn(unused_assignments)] on b | labels: A-lints, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_28571", "text": "[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", "label": "medium", "label_id": 2} {"id": "rust_28572", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28575", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28576", "text": "ICE in type checker | Code: ``` rust use std::ops::Add; pub trait State: Add { fn new() -> State; } ``` 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", "label": "high", "label_id": 1} {"id": "rust_28579", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28581", "text": "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 ", "label": "question", "label_id": 4} {"id": "rust_28583", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28586", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28587", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28590", "text": "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 ``` :3:5: 3:37 error: the trait `core::clone::Clone` is not implemented for the type `unsafe extern \"C\" fn(&u32)` [E0277] :3 test: unsafe extern \"C\" fn(&u32) ^~~", "label": "medium", "label_id": 2} {"id": "rust_28591", "text": "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]", "label": "medium", "label_id": 2} {"id": "rust_28592", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28594", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28595", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28597", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28599", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28600", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28601", "text": "`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 {", "label": "medium", "label_id": 2} {"id": "rust_28604", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28606", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28609", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28614", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28624", "text": "Colors messed up in compiler output | ``` $ vim src/lib.rs (BROWN BEGIN)src/lib.rs:153 fn function(&self) -> { src/lib.rs:154 src/lib.rs:155 if { src/lib.rs:156 src/lib.rs:157 } else { src/lib.rs:158 ... warning: (BROWN END)method is never used: `function`, #[warn(dead_code)] on b | labels: A-frontend", "label": "medium", "label_id": 2} {"id": "rust_28625", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28627", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28628", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28630", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28639", "text": "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 ", "label": "medium", "label_id": 2} {"id": "rust_28641", "text": "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?", "label": "medium", "label_id": 2} {"id": "rust_28643", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28644", "text": "HIR: Move lifetime elision to HIR lowering | If we can | labels: A-HIR", "label": "medium", "label_id": 2} {"id": "rust_28647", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28648", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28653", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28657", "text": "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` and `Option` commonly encounte | labels: A-parser", "label": "medium", "label_id": 2} {"id": "rust_28658", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28659", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28660", "text": "Hint the generic type and possible bounds on the unimplemented trait error | ``` rust fn f(x: T) { x + 4; } fn g(x: T) { println!(\"{}\", x); } fn h(x: T) { trait X {} fn hh(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", "label": "medium", "label_id": 2} {"id": "rust_28667", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28670", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28671", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28676", "text": "[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", "label": "medium", "label_id": 2} {"id": "rust_28684", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28687", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28690", "text": "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 ::Target = [Self::Item] { type Item; } ``` and various variations of it including ``` rust trait Array: Deref + DerefMut { ", "label": "question", "label_id": 4} {"id": "rust_28692", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28693", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28695", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28696", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28699", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28700", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28701", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28704", "text": "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 ", "label": "medium", "label_id": 2} {"id": "rust_28706", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28708", "text": "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 Warn about -A Allow -D Deny -F Forbid (deny, and deny all overrides) ``` The documentation here for `-F` suggests to me that `-F | labels: A-frontend, E-easy", "label": "low", "label_id": 3} {"id": "rust_28709", "text": "'-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", "label": "medium", "label_id": 2} {"id": "rust_28710", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28712", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28713", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28714", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28716", "text": "--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", "label": "medium", "label_id": 2} {"id": "rust_28718", "text": "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) ", "label": "medium", "label_id": 2} {"id": "rust_28720", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28721", "text": "Higher ranked lifetimes cannot cross type boundaries | This currently does not compile: ``` rust struct Message<'a> { data: &'a u32, } struct Handler(Option>); struct Cfg { handler: for<'a> Handler>, // error: `Handler` is not a trait [E0404] } ``` This precludes a lot of useful patterns. | labels: A-lifetimes", "label": "medium", "label_id": 2} {"id": "rust_28726", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28728", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28733", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28734", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28735", "text": "--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.", "label": "question", "label_id": 4} {"id": "rust_28737", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28739", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28740", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28747", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28750", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28751", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28752", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28756", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28766", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28773", "text": "There should be a Box -> Box From conversion | This conversion is done implicitly, but implicit conversions aren't done in generic lookup. This means that ``` rust fn foo() -> Result<(), Box> { try!(Err(\"foo\")) } fn bar() -> Result<(), Box> { try!(foo()); } ``` will fail, which is obnoxious and mea", "label": "medium", "label_id": 2} {"id": "rust_28774", "text": "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) ``` #[derive(Debug)] struct MatrixXf { rows: usize, cols: usize, values: Vec } macro_rules! mat { [ $($( $x: expr ),*);* ] => {{ let mut tmp_vec = Vec::new(); let mut ro | labels: A-macros", "label": "medium", "label_id": 2} {"id": "rust_28775", "text": "Unexpected behaviour of std::convert::From | I've confused by this: ``` rust use std::convert::From; pub trait MyFrom { fn from(T) -> Self; } enum Chameleon { Red, Green, Blue } // This works impl MyFrom for Chameleon { fn from(h: Chameleon) -> Chameleon { h } } // But this doesn't! // error: conflicting imple", "label": "medium", "label_id": 2} {"id": "rust_28776", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28777", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28784", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28794", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28796", "text": "Tracking issue for FnBox() | This is a tracking issue for the `fn_box` feature and `FnBox` trait, which allows a `Box _>` 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 | labels: T-lang, T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close", "label": "medium", "label_id": 2} {"id": "rust_28799", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28800", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28801", "text": "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: ``` :2:47: 2:55 error: | labels: T-compiler", "label": "high", "label_id": 1} {"id": "rust_28803", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28804", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28809", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28810", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28822", "text": "const fn with `_` as an arg name vomits | ## Doesn't work: ``` rust #![feature(const_fn)] fn main(){} const fn size_ofs(_: usize) { } ``` ``` :3:19: 3:20 error: arguments of constant functions can only be immutable by-value bindings [E0022] :3 const fn size_ofs(_: usize) { } ^ :3:19: 3:20 help: see the | labels: E-easy, E-mentor, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_28824", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28828", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28830", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28834", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28835", "text": "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 ", "label": "low", "label_id": 3} {"id": "rust_28837", "text": "Error \"binary operation `==` cannot be applied to type\" -> print note that PartialEq might be missing | The error ``` :5:8: 5:18 error: binary operation `==` cannot be applied to type `core::result::Result` [E0369] :5 if ! ( * left_val == * right_val ) { ^~~~~~~~~~ src\\lib.rs:34:3: 34:41 note: in this expansion of assert | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28838", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28839", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28843", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28844", "text": "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", "label": "high", "label_id": 1} {"id": "rust_28848", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_28850", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28851", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28853", "text": "#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", "label": "critical_bug", "label_id": 0} {"id": "rust_28854", "text": "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(){} ``` ``` :5:20: 5:29 error: cannot infer an appropriate lifetime due to conflicti | labels: regression-from-stable-to-nightly, P-high, T-compiler", "label": "critical_bug", "label_id": 0} {"id": "rust_28859", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28860", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28862", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28870", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28871", "text": "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::T>; } ``` ``` error: unable to infer enough type information about | labels: A-associated-items, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_28879", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28881", "text": "Possibly-incorrect coherence error with blanket impl bounded by a trait with type param | This fails to compile: ``` rust trait Base {} trait Foo {} impl> Foo for T {} struct Bar(T); impl Foo for Bar {} fn main() {} ``` ``` :4:1: 4:36 error: conflicting implementations for trait `Foo` [E0119] :4 impl> Foo | labels: A-trait-system, T-lang", "label": "medium", "label_id": 2} {"id": "rust_28883", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28890", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28899", "text": "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 = \"ōōōōōōōōōō\\u{}\"; ^ error: aborting due to 2 previous errors ``` the first e", "label": "medium", "label_id": 2} {"id": "rust_28901", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28903", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28912", "text": "LLVM lint: Memory reference address is misaligned | This is a subissue of #7463. ``` rust pub enum H { L(A), R(B), } pub fn test() -> H { 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", "label": "medium", "label_id": 2} {"id": "rust_28917", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28918", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28924", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28927", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28934", "text": "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(&mut self, parse: F) -> Result 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", "label": "critical_bug", "label_id": 0} {"id": "rust_28935", "text": "IndexMut incorrectly chosen instead of Index | ``` rust use std::ops::{Index, IndexMut}; struct S; impl S { fn foo(&self) -> i32 { 0 } } impl Index for S { type Output = S; fn index(&self, _: usize) -> &S { self } } impl IndexMut 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", "label": "medium", "label_id": 2} {"id": "rust_28936", "text": "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, U, F>( _session: &mut Session, _tokens: T, _f: F) -> U whe | labels: A-lifetimes, E-needs-test, P-low, T-compiler", "label": "high", "label_id": 1} {"id": "rust_28937", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28939", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28940", "text": "`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", "label": "medium", "label_id": 2} {"id": "rust_28942", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28943", "text": "Adding more information can make type inference fail. | I think the case is best illustrated by an example: ``` rust fn test() -> Vec { 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", "label": "medium", "label_id": 2} {"id": "rust_28944", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28946", "text": "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 { type Output; fn dot(self, rhs: Other) -> Self::Output; } impl<'a, T> Dot<&'a T> for T where T: Dot + Copy { type Output = T::Output; fn dot(self, rhs: &T) -> Self::Output { self.dot(*rhs) } } ``` When | labels: I-ICE, E-needs-test, C-bug", "label": "high", "label_id": 1} {"id": "rust_28947", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28950", "text": "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 ", "label": "medium", "label_id": 2} {"id": "rust_28951", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28952", "text": "Optimize enum layout | See https://github.com/rust-lang/rust/issues/20638, which was vandalised and seemingly never reopened (?)", "label": "medium", "label_id": 2} {"id": "rust_28953", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28955", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28956", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28958", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28961", "text": "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.", "label": "low", "label_id": 3} {"id": "rust_28962", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28968", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28970", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28971", "text": "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) 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", "label": "high", "label_id": 1} {"id": "rust_28972", "text": "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: ``` :7:9: 7:22 error: no associated item named `Quux` found for type `Foo` in the current scope :7 | labels: C-enhancement, A-diagnostics, WG-diagnostics", "label": "low", "label_id": 3} {"id": "rust_28974", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28975", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28976", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28978", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28979", "text": "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", "label": "low", "label_id": 3} {"id": "rust_28981", "text": "WTF Error Message with `impl Deref for T | Play link: http://is.gd/WYlDGu ``` rust use std::ops::Deref; struct Foo; impl Deref for Foo { } fn main() {} ``` Error message: ``` :5:1: 5:28 error: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct`); only traits defined i | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_28983", "text": "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 = ::T; pub extern \"C\" fn test(t : I) {} ``` trace : ``` thread 'rustc' panicked at 'Box', ../s", "label": "medium", "label_id": 2} {"id": "rust_28984", "text": "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", "label": "question", "label_id": 4} {"id": "rust_28992", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28994", "text": "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 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", "label": "medium", "label_id": 2} {"id": "rust_28995", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_28996", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28998", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_28999", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29000", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29002", "text": "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 { fn extract(&self) -> Option; } struct Container; impl Extractor for Container { fn extract(&self) -> Option { None } } fn expected(_: &str) { } fn main()", "label": "medium", "label_id": 2} {"id": "rust_29005", "text": "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`.", "label": "medium", "label_id": 2} {"id": "rust_29008", "text": "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", "label": "low", "label_id": 3} {"id": "rust_29010", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29011", "text": "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 ", "label": "low", "label_id": 3} {"id": "rust_29019", "text": "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:", "label": "low", "label_id": 3} {"id": "rust_29023", "text": "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: PhantomData, } impl Baz { pub fn new() -> Baz { Baz { _t: PhantomData } } } impl Baz { pub fn new( | labels: A-resolve", "label": "medium", "label_id": 2} {"id": "rust_29025", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29030", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29034", "text": "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() {} :8:20: 8:33 error: This node does not have a stability att | labels: A-stability", "label": "medium", "label_id": 2} {"id": "rust_29037", "text": "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) -", "label": "medium", "label_id": 2} {"id": "rust_29041", "text": "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", "label": "question", "label_id": 4} {"id": "rust_29042", "text": "Parsing \"+\" or \"-\" to f32/f64 on nightly | I tried this code: ``` match \"+\".parse::() { Ok(v) => println!(\"f32 OK: {}\", v), Err(e) => println!(\"f32 Error: {}\", e) } match \"-\".parse::() { 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", "label": "critical_bug", "label_id": 0} {"id": "rust_29043", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29048", "text": "Nightly regression: Incorrect \"parameter type may not live long enough\" warning | Testcase: ``` rust use std::marker::PhantomData; pub struct WebDriverHttpApi { _routes: PhantomData, } impl WebDriverHttpApi { pub fn new(extension_routes:Vec<(&str, U)>) -> WebDriverHttpApi { 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", "label": "critical_bug", "label_id": 0} {"id": "rust_29049", "text": "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", "label": "question", "label_id": 4} {"id": "rust_29052", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29053", "text": "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 '
' panicked at 'index 0 | labels: E-easy, E-needs-test, P-medium, T-compiler, A-MIR, I-unsound", "label": "critical_bug", "label_id": 0} {"id": "rust_29056", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29057", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29063", "text": "[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", "label": "low", "label_id": 3} {"id": "rust_29064", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29067", "text": "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", "label": "question", "label_id": 4} {"id": "rust_29071", "text": "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 () ```", "label": "medium", "label_id": 2} {"id": "rust_29073", "text": "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.", "label": "medium", "label_id": 2} {"id": "rust_29077", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29078", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29084", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29088", "text": "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: ``` :2:7: 2:8 error: byte constant must be ASCII. Use a \\xHH escape for a non-ASCII byte: \\u{2192} :2 b'→' ^ ``` A lot of people read this as | labels: A-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_29092", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29093", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29094", "text": "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", "label": "low", "label_id": 3} {"id": "rust_29095", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29097", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29101", "text": "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`, with the expectation that futur", "label": "medium", "label_id": 2} {"id": "rust_29103", "text": "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", "label": "critical_bug", "label_id": 0} {"id": "rust_29106", "text": "`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", "label": "medium", "label_id": 2} {"id": "rust_29107", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_29115", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29116", "text": "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", "label": "high", "label_id": 1} {"id": "rust_29120", "text": "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`.", "label": "medium", "label_id": 2} {"id": "rust_29121", "text": "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` 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", "label": "medium", "label_id": 2} {"id": "rust_29122", "text": "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", "label": "medium", "label_id": 2} {"id": "rust_57247", "text": "false positive non-exhaustive patterns: pattern guarded outside of match | ````rust pub fn func(a: Option, b: Option) { 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)) => {} ", "label": "medium", "label_id": 2} {"id": "rust_57248", "text": "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", "label": "medium", "label_id": 2}