{"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 | src/report/data.rs:310:24 [INFO] [stdout] | [INFO] [stdout] 310 | assert_eq!(offset_of!(ReportData, vtable), 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ | labels: P-medium, A-borrow-checker, regression-from-stable-to-beta, C-bug, finished-final-comment-period, disposition-close", "label": "critical_bug", "label_id": 0} {"id": "rust_147555", "text": "Tracking Issue for AArch64 FEAT_JSCVT | The feature gate for the issue is `#![feature(\"stdarch_aarch64_jscvt\")]`. # Public API This feature covers the intrinsic from the AArch64 `\"jsconv\"` target feature > Floating-point JavaScript convert to signed fixed-point, rounding toward zero ```rust #[target | labels: T-lang, T-libs-api, C-tracking-issue, disposition-merge, finished-final-comment-period, A-intrinsics", "label": "question", "label_id": 4} {"id": "rust_122034", "text": "Tracking Issue for raw-pointer-to-reference conversion methods | I tried this code: ```rust #![warn(unreachable_pub)] mod foo { pub struct Foo; } use foo::Foo; ``` [He | labels: A-lints, C-bug, L-unreachable_pub", "label": "medium", "label_id": 2} {"id": "rust_152078", "text": "Potential in-module UB in alloc | `HOOK` is a static variable: https://github.com/rust-lang/rust/blob/5ac8ecea36e7548534e0bc3d4aa1c12bd4908566/library/std/src/alloc.rs#L297 `rust_oom` transmutes a pointer `hook` obtained from HOOK into a function: https://github.com/rust-lang/rust/blob/5ac8ece | labels: C-bug, T-libs", "label": "critical_bug", "label_id": 0} {"id": "rust_148470", "text": "Partial pointers in padding can make const-eval fail | I'm not sure if this is a bug or not. ```rust #![allow(unused)] #[repr(C, align(16))] #[derive(Clone, Copy)] struct Thing { x: u128, y: u64, // Replace the above line with the below line to make it stop compiling // y: std::mem::MaybeUninit, // 8 bytes of | labels: T-lang, T-compiler, C-bug, A-const-eval, A-ABI, T-opsem", "label": "question", "label_id": 4} {"id": "rust_151591", "text": "[ICE]: assertion failed: layout.is_sized() | ```rust struct NoDefault {} #[derive(Default)] struct VecHolder { data: Vec, } fn main() { let x | labels: C-bug", "label": "medium", "label_id": 2} {"id": "rust_151643", "text": "rustc `--color always` doesn't always output color | Zulip discussion: [#t-compiler > Rustc `--color always` doesn't always color output](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Rustc.20.60--color.20always.60.20doesn't.20always.20color.20output/with/568526766) While workin | labels: A-diagnostics, T-compiler, C-bug, D-inconsistent, A-error-codes", "label": "question", "label_id": 4} {"id": "rust_152043", "text": "Miscompilation with vectors | I tried this code: ```rust use std::ops::{Add, Mul}; #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] pub struct Vector2 { pub x: S, pub y: S, } impl Add> for Vector2 where S: Add + Copy, { type Output = Vector2; fn add(sel | labels: C-bug", "label": "medium", "label_id": 2} {"id": "rust_127643", "text": "ICE: `assertion failed: layout.is_sized()` with `feature(associated_const_equality)` | I tried this code: ```rust #![crate_type = \"lib\"] pub trait X{} pub struct Y; #[diagnostic::do_not_rec | labels: A-attributes, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_151983", "text": "Missing \"unused variable\" warning when using a match guard | I tried this code: ```rust fn main() { match Some(42) { Some(unused) if true => (), _ => (), } } ``` I | labels: A-lints, P-medium, T-compiler, regression-from-stable-to-stable, C-bug, L-unused_variables", "label": "critical_bug", "label_id": 0} {"id": "rust_142519", "text": "Function no longer auto-vectorizes in 1.87.0 | ### | labels: A-LLVM, I-slow, E-needs-test, P-high, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_85532", "text": "Tracking Issue for bigint helper methods | I tried this code with `-Zchecksum-freshness` enabled on cargo side: ```rust // random_bytes have to b | labels: T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_151855", "text": "Failure when compiling rustc due to file permissions in /usr | ### Summary I'm compiling rustc in an openSUSE docker container. When running `make` I very quickly get an error because it's trying to copy `/usr` to `stage0-sysroot`. The file in question is this one: ```sh -rwsr-x--- 1 root messagebus 56K Jun 20 2023 /usr/l | labels: T-bootstrap, C-bug", "label": "question", "label_id": 4} {"id": "rust_62263", "text": "ICE \"not a type parameter\" on nightly (regression) | Repro: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c4a8f90dada13368b5749e84b7b01108 ```rust pub type PrivacyPolicy = Vec>>; pub trait PrivacyRule { type ViewerContext; | labels: I-ICE, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62265", "text": "GAT cannot infer implicit lifetime bounds. | I'm trying to simulate closures returning mutable captured variable with GAT-version `FnMut`. It cannot infer implicit bound `'a: 'r` here and emit an error. But there is `self: &'r mut Self` alive while `Self` contains `&'a mut i32`. ```rust #![feature(generic_associated_types)] | labels: A-lifetimes, I-ICE, A-associated-items, T-compiler, A-NLL, C-bug", "label": "high", "label_id": 1} {"id": "rust_62266", "text": "Exempt Miri from \"no tools breakage the week before beta cutoff\"? | Would it make sense to exempt Miri from the rule that tools must not regress the week before the beta is branched? Miri is anyway not distributed with the beta, it's a nightly-only tool. And this \"no breakage\" rule makes landing PRs during that timeframe very painful. Cc @rust-la | labels: T-infra, A-miri", "label": "medium", "label_id": 2} {"id": "rust_62269", "text": "error[E0432]: unresolved import `std::sync::atomic::AtomicU64` | https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:Factory/rust/p/ppc Dist RLS stage2 (powerpc-unknown-linux-gnu) Building stage2 tool clippy-driver (powerpc-unknown-linux-gnu) Finished release [optimized] target(s) in 0.59s Building stage2 tool rls (powerpc-un | labels: A-codegen, A-resolve, T-compiler, O-PowerPC, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62272", "text": "Unconditionally breaking `loop`s not allowed in constants. | *Technically* a regression from 1.24 to 1.25, but I don't think anyone used this. Example code which used to be allowed: ```rust pub const FOO: () = loop { break; }; ``` I'm pretty sure this changed with #47802, which added the `FalseUnwind` terminator to MIR, but didn't handle i | labels: A-MIR, regression-from-stable-to-stable, A-const-eval", "label": "critical_bug", "label_id": 0} {"id": "rust_62273", "text": "Initialization by assignment not allowed for \"drop-ful\" types in constants. | In the following example, `FOO` and `ASSIGN` are allowed but `FOO_ASSIGN` isn't: ```rust pub struct Foo; impl Drop for Foo { fn drop(&mut self) {} } pub const FOO: Foo = { let x = Foo; x }; pub const ASSIGN: i32 = { let x; x = 0; x }; pub const FOO_ASSIGN: Foo = { let x; x = Foo; | labels: T-compiler, A-MIR, C-bug, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_62276", "text": "DOS Line Endings in install.sh on some rust-std nightlies | Since the change from travis to azure pipelines some of the rust-std archives have DOS line endings in their `install.sh` script, which results in errors like the following when trying to execute: ``` # ./install.sh bash: ./install.sh: /bin/bash^M: bad interpreter: No such file o | labels: P-high, regression-from-stable-to-beta, T-infra, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62277", "text": "Move `compile-pass` tests to `check-pass` or `build-pass` | `compile-pass` was the old way to assert that UI tests were able to successfully build. However, it would do a full build of the code, including codegen and linking. Many of our tests don't need this, however, and should instead use the new `check-pass`, introduced in https://git | labels: C-cleanup, A-testsuite, E-mentor, T-compiler, E-medium, A-compiletest", "label": "low", "label_id": 3} {"id": "rust_62280", "text": "Tracking issue for `slice_take` | Feature gate: `#![feature(slice_take)]` ### Public API ```rust impl [T] { fn split_off<'a, R: OneSidedRange>(self: &mut &'a Self, range: R) -> Option<&'a Self>; fn split_off_mut<'a, R: OneSidedRange>(self: &mut &'a mut Self, range: R) -> Option<&'a mut Self>; fn | labels: T-libs-api, C-tracking-issue, disposition-merge, finished-final-comment-period, A-slice", "label": "question", "label_id": 4} {"id": "rust_62288", "text": "Box::into_pin is unstable but has #0 as the tracking issue | Please see https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_pin : ![screenshot](https://cdn.discordapp.com/attachments/273541522815713281/595422844398075919/unknown.png) | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62289", "text": "Leak when returning out of box syntax | @nils-ohlmeier mentioned a leak coming from `vec![f()?]` but not `vec![f()?; 1]` [here](https://github.com/mozilla/webrtc-sdp/blob/master/src/attribute_type.rs#L2158-L2160), I think I tracked this down to the use of `box` in `vec!` when given a comma-separated list. I've made [a | labels: T-compiler, A-MIR, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62299", "text": "There's a bug when you multiply two Numbers | use std::ops::Mul; amount is 2224.0001_f64 my result=== amount_clone.mul(10000.0)=22240001.000000004----amount_clone.mul(10000.0).floor()=22240001 my code== println!(\"amount_clone.mul(10000.0)={}----amount_clone.mul(10000.0).floor()={}\",amount_clone.mul(10000.0),amount_clone.mul(", "label": "medium", "label_id": 2} {"id": "rust_62301", "text": "1.36 changes the `UnwindSafe` impl precondition for HashMap | https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0e5a528fc978a90aa15bbf01f68dd1bf ```rust assert_unwind_safe::>>(); ``` Successfully compiles on stable 1.35, fails on beta/pre 1.36. | labels: A-collections, T-libs-api, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62302", "text": "provide thread name to OS for Solarish systems | Both Solaris 11 and recentish Illumos provide the same `pthread_setname_np()` API. While libstd can't presume the existence of the symbol, it seems like using `weak!` works sufficiently to set the thread name when necessary. While the implementation is different, the API is basic | labels: T-libs-api, O-solaris", "label": "medium", "label_id": 2} {"id": "rust_62303", "text": "Any trait should be unsafe | ## What is wrong? Since `type_id()` is stable rust programs rely on `Any` to be implemented correctly for rust safety relevant thinks (like downcast). Given the coding guide lines `Any` needs to be a `unsafe`-to-implement trait as implementing it wrongly causes unsafety. ## Is it | labels: A-DSTs, T-lang, T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62305", "text": "Nightly compiler panic on using Self with associated type in type alias | ## Description The `nightly` compiler panics when using `Self` in a type alias along with an associated type. This does not happen on `stable` or `beta`. Code snippet: ``` type Target = Self::Target; ``` [Playground Link](https://play.rust-lang.org/?version=nightly&mode=debug&edi | labels: regression-from-stable-to-nightly, A-associated-items, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62307", "text": "structural_match bug: deep refs like `& &B` leak use of PartialEq | (Spawned off of investigation of #61188) rust-lang/rfcs#1445 says that we're supposed to reject uses of consts with ADT's that don't implement `#[structural_match]` (i.e. ADT's that do not do `#[derive(PartialEq, Eq)]`. Unfortunately, we did not quite finish the job. Consider the | labels: T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62308", "text": "libstd requires explicit version of rand crate | Most everything else in the rustc repo that needs the rand crate is specifying \"0.6\" for the version, while libstd has \"0.6.1\" in its Cargo.toml. Unfortunately, this prevented rust from building on illumos systems without manually patching the rand crate (and is a blocker for rus | labels: C-enhancement, T-libs-api", "label": "low", "label_id": 3} {"id": "rust_62312", "text": "Future compat warning with `.await`ing a `BoxFuture` | The code is the same as in https://github.com/rust-lang/rust/issues/62284: ```rust #![feature(async_await)] use std::future::Future; use std::pin::Pin; type BoxFuture = Pin>>; async fn foo() -> BoxFuture { Box::pin(bar()) as _ } async fn bar() { let _ | labels: P-high, T-compiler, A-MIR, I-unsound, C-bug, A-async-await", "label": "critical_bug", "label_id": 0} {"id": "rust_62313", "text": "Conflicting documentation on the alignment requirements for `ptr::copy` | The docs for [`ptr::drop_in_place`](https://doc.rust-lang.org/nightly/std/ptr/fn.drop_in_place.html) state: > Unaligned values cannot be dropped in place, they must be copied to an aligned location first: And include an example which uses `ptr::copy` to copy the value from an una | labels: T-lang, T-libs-api, A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_62314", "text": "stdlib incorrectly handles O_PATH | There are several bugs here, but they all stem from the same problem -- the stdlib doesn't handle `O_PATH` correctly in a few places. ## `O_PATH` requires you to set an extra (unused) mode. ## `O_PATH` causes most other flags to be ignored, so requiring a mode is a little bit wei", "label": "critical_bug", "label_id": 0} {"id": "rust_62315", "text": "Use DataflowResultsCursor instead of FlowAtLocation | #61922 introduced `DataflowResultsCursor`, which provides a stateful caching interface atop `FlowAtLocation`. It would be better to use `DataflowResultsCursor` from more places, both because it's a more convenient / less error-prone interface, and because it's best to have more t | labels: C-cleanup, T-compiler, A-MIR", "label": "question", "label_id": 4} {"id": "rust_62318", "text": "Support panic=abort without #[should_panic] from libtest | When a project wants to turn on `panic=abort` today, they are forced to choose between 1. Re-compiling their whole project with `panic=unwind` for the purpose of running tests (this not only creates longer build times, but also changes the behavior of code between testing and pro | labels: T-lang, T-compiler, T-dev-tools, C-feature-request, A-libtest", "label": "question", "label_id": 4} {"id": "rust_62325", "text": "$crate incorrectly substituted in attribute macro invocation containing bang macro invocation | When an attribute macro input contains `$ident`, it is correctly substituted both inside and outside of a function-like macro invocation i.e. both of the $ident's in `[u8; $ident + m!($ident)]` would be substituted as expected. But when an attribute macro input contains `$crate`, | labels: A-macros, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62326", "text": "ICE with generic associated types | Hi, Following code: ```rust #![feature(generic_associated_types)] trait Iterator { type Item<'a>: 'a; } ``` ... fails with: ``` error: internal compiler error: Region parameter out of range when substituting in region 'a (root type=None) (index=1) thread 'rustc' panicked at 'no e | labels: A-lifetimes, I-ICE, A-associated-items, T-compiler, C-bug, F-generic_associated_types", "label": "high", "label_id": 1} {"id": "rust_62328", "text": "Increasing Rc::strong_count above u8::MAX causes alignment issues and segfault in FFI code | ```console $ rustc --version --verbose rustc 1.37.0-nightly (d132f544f 2019-06-07) binary: rustc commit-hash: d132f544f9d74e3cc047ef211e57eae60b78e5c5 commit-date: 2019-06-07 host: x86_64-apple-darwin release: 1.37.0-nightly LLVM version: 8.0 ``` The following program segfaults i | labels: A-FFI, T-libs-api", "label": "high", "label_id": 1} {"id": "rust_62334", "text": "Change \"A non-empty glob must import something with the glob's visibility\" to be a lint? | Consider the following three examples: A and C are accepted and B has a compilation error. However, the message reported in B looks more like a lint than a compilation error. A consequence of this error is that adding a non-public function to a module (e.g. the `bar` in B) may br | labels: E-easy, A-lints, A-resolve, E-mentor, T-lang", "label": "question", "label_id": 4} {"id": "rust_62336", "text": "wart: non-Eq [T; 0] can be matched as if T were `#[structural_match]` | Spawned off of investigation of issue #62307 and PR #55837 We currently allow constants that are empty arrays of any type to be used as patterns in `match`. We allow this regardless of whether they are an array of an ADT that does not derive `PartialEq`/`Eq` This may be a feature | labels: T-lang, A-patterns, A-ZST, A-array", "label": "question", "label_id": 4} {"id": "rust_62338", "text": "`clippy-driver` no longer builds after rust-lang/rust#61995 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#61995, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @eddyb, do you think you | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62342", "text": "library compilation problem on s390x | I'm getting the following error when building `Parity Ethereum`: ``` LLVM ERROR: Cannot select: 0x3ff58cd1598: i32 = SystemZISD::GET_CCMASK 0x3ff58cd13f8, Constant:i32<15>, Constant:i32<3> 0x3ff58cd13f8: i32 = srl 0x3ff58a47040, Constant:i32<31> 0x3ff58a47040: i32 = add 0x3ff58cd | labels: A-LLVM, T-compiler, C-bug, O-SystemZ", "label": "medium", "label_id": 2} {"id": "rust_62347", "text": "`miri` no longer builds after rust-lang/rust#62335 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62335, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Mark-Simulacrum, do you think you would | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62348", "text": "const fns have no documentation | `const` functions seems to be an entirely undocumented language feature. As far as I can see, it's not mentioned anywhere in book or the reference. Judging by the release notes, they've been in the language since before 1.33, so it seems to just have been forgotten? | labels: A-docs, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_62350", "text": "FFI broken with many parameters | We encountered this with WebRender, where we exposed a method in Rust to the Gecko, and the last parameters supplied appeared random on the Rust side. I made a reduced test case adapted from it that you can grab at: https://github.com/aosmond/myrustffi It is a very simple test ca | labels: A-codegen, A-FFI, O-x86_64, P-high, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_62353", "text": "ICE: `rustc` crashes in a `chroot` sandbox | This error happens when running `cargo` from `bazel`, which is in turn running in a `chroot` sandbox on Centos 7. Running with `RUST_BACKTRACE=1` unfortunately makes the error disappear, so we don't know why `rustc` needs to read `/proc/self/exe` and why only when compiling DD. T | labels: I-ICE, P-medium, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62357", "text": "Add valid examples to `std::ptr::{read,write}_unaligned` | With https://github.com/rust-lang/rust/pull/62323 the only example (that had UB and was thus invalid) in `std::ptr::read_unaligned` and `std::ptr::write_unaligned` is removed. We should add a valid example of using the aforementioned functions. cc @rust-lang/wg-unsafe-code-guidel | labels: E-easy, C-enhancement, A-docs", "label": "low", "label_id": 3} {"id": "rust_62358", "text": "Tracking issue for `Option::contains` and `Result::contains` | This is a tracking issue for `Option::contains` and `Result::contains`. The implementations are as follows: ```rust pub fn contains(&self, x: &T) -> bool where T: PartialEq { match self { Some(y) => y == x, None => false, } } pub fn contains(&self, x: &T) -> bool where T: Partial | labels: T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close, A-result-option", "label": "medium", "label_id": 2} {"id": "rust_62361", "text": "compiler optimized out function call which has side effects ? | I found following code ```rst TcpListener::bind(\"127.0.0.1:1234\"); std::thread::sleep_ms(99999999); ``` didn't listen during running, but if I change it to ```rst let _s=TcpListener::bind(\"127.0.0.1:1234\"); std::thread::sleep_ms(99999999); ``` it listened as expected, is this a b", "label": "medium", "label_id": 2} {"id": "rust_62362", "text": "`miri` no longer builds after rust-lang/rust#62355 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62355, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have tim | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62364", "text": "ICE on self-referential typedef | So, while writing some _really nasty_ code for an interpreter, I ended up with an overcomplicated version of this code: ```rust use std::sync::Arc; pub enum ThingOrRef where S: AsRef { ThingRef(S), Thing } pub type ThingArena<'ctx, T> = ThingOrRef>; ``` ([Playg | labels: I-ICE, regression-from-stable-to-nightly, P-high, T-compiler", "label": "critical_bug", "label_id": 0} {"id": "rust_62370", "text": "Tracking issue for Box::into_pin (feature `box_into_pin`) | This is a tracking issue for `Box::into_pin` implemented in https://github.com/rust-lang/rust/pull/57313 ```rust impl Box { pub fn into_pin(boxed: Box) -> Pin>; } ``` | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, Libs-Tracked", "label": "medium", "label_id": 2} {"id": "rust_62373", "text": "Improve diagnostics on self types in function signature | ```rust struct A; impl A { fn foo(self: Box) {} } fn main() { A.foo() } ``` gives ```text error[E0599]: no method named `foo` found for type `A` in the current scope --> src/main.rs:8:7 | 1 | struct A; | --------- method `foo` not found for this ... 8 | A.foo() | ^^^ ``` Wh | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62375", "text": "Internal compiler error with enums | Hello, I found a bug while developing a project who produce an internal error. I create this code to reproduce the error: ``` struct TypeA { attr: String, attr2: usize, } struct TypeB { attr: usize, attr2: Vec, } enum En { Value(TypeA), OtherValue(TypeB), None } fn main() | labels: I-ICE, E-needs-test, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62382", "text": "Unhelpful span in async type inference error | The following snippet [(playground)](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=1af2816e9147c55126a2658e46f1453e): ```rust #![feature(async_await)] use std::future::Future; fn get_future() -> impl Future { panic!() } async fn foo() { let | labels: C-enhancement, A-diagnostics, T-compiler, A-inference, A-async-await", "label": "low", "label_id": 3} {"id": "rust_62386", "text": "Invalid suggestion when attempting to call async closure | The following snippet: ```rust #![feature(async_await)] fn main() { async || ({ })(); } ``` produces the following error: ``` error[E0618]: expected function, found `()` --> src/main.rs:4:14 | 4 | async || ({ | ______________^ | |______________| | || 5 | || })(); | ||______^_- ca | labels: A-closures, T-compiler, C-bug, A-async-await, A-suggestion-diagnostics, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_62387", "text": "diagnostics: suggest iter_mut() where trying to modify .iter()'ed vector elements inplace | code: ````rust #[derive(Debug)] struct A { a: i32, } impl A { fn double(&mut self) { self.a += self.a } } fn main() { let mut v = [A { a: 4 }]; v.iter().for_each(|a| a.double()); println!(\"{:?}\", v); } ```` The code gives the following not-very-helpful warning: ```` error[E0596]: | labels: C-enhancement, A-diagnostics, T-compiler, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_62389", "text": "Crater runs for Rust 1.37.0 | labels: S-waiting-on-review", "label": "medium", "label_id": 2} {"id": "rust_62394", "text": "future doc in doc.rs still use await! | it supposed to be .await? https://doc.rust-lang.org/std/future/trait.Future.html > The core method of future, poll, attempts to resolve the future into a final value. This method does not block if the value is not ready. Instead, the current task is scheduled to be woken up when ", "label": "medium", "label_id": 2} {"id": "rust_62395", "text": "Const generics with function pointers produces linker error. | When attempting to compile a program using const generic function pointers, I get the following linker error: ``` error: linking with `cc` failed: exit code: 1 | = note: \"cc\" \"-Wl,--as-needed\" \"-Wl,-z,noexecstack\" \"-m64\" \"-L\" \"/root/.rustup/toolchains/nightly-x86_64-unknown-linux | labels: A-linkage, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "medium", "label_id": 2} {"id": "rust_62397", "text": "Get rid of uses of mem::uninitialized | https://github.com/rust-lang/rust/commit/007d87f1719e2fcf2ff36aef8b6dc866fa276386 added a bunch of `allow(deprecated)` because there are still a few places where we use `mem::uninitialized`. These should all be fixed, to remove the `allow` (and hopefully prevent other deprecated | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_62400", "text": "Confusing diagnostic for lifetime mismatch | This [came up on StackOverflow](https://stackoverflow.com/q/56897524) today. In reduced form, this function ```rust fn foo(x: &mut &mut T) { *x = *x; } ``` results in this error message ``` error[E0623]: lifetime mismatch --> src/lib.rs:2:10 | 1 | fn foo(x: &mut &mut T) { | | labels: C-enhancement, A-diagnostics, A-lifetimes, T-compiler, A-NLL, fixed-by-NLL", "label": "low", "label_id": 3} {"id": "rust_62401", "text": "Group all ABI tests. | There are a bunch of run-pass tests that should be in `run-pass/abi` (or some other directory if anyone has a better suggestion), and many of them are mentioned here: https://github.com/rust-lang/rust/blob/baab1914ec9a9742776a8147780947b48fddf54d/src/test/run-pass/abi-sysv64-arg- | labels: E-easy, C-cleanup, A-testsuite, E-mentor, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62402", "text": "`x.py build --warnings deny` does not fail despite warnings | I patched libstd and wanted to be sure it builds without warnings, so I did: ``` $ ./x.py build --stage 0 src/libstd --warnings deny ``` However, this build succeeded despite there being warnings: ``` Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux | labels: T-compiler, T-bootstrap", "label": "medium", "label_id": 2} {"id": "rust_62411", "text": "Tracking issue for `indirect_structural_match` compatibility lint | This is the **summary issue** for the `indirect_structural_match` future-compatibility warning and other related errors. The goal of this page is describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or regist | labels: C-future-incompatibility, A-maybe-future-edition", "label": "question", "label_id": 4} {"id": "rust_62412", "text": "Panic in ::fmt | Got this error when running `cargo build`: ``` thread 'rustc' panicked at 'no entry found for key', src\\libcore\\option.rs:1034:5 stack backtrace: 0: std::sys_common::alloc::realloc_fallback 1: std::panicking::take_hook 2: std::panicking::take_hook 3: rustc::ty::structural_impls:: | labels: I-ICE, T-compiler, A-MIR, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_62415", "text": "Random lines of code(?) printed into azure logs | Some sample logs: * https://dev.azure.com/rust-lang/e71b0ddf-dd27-435a-873c-e30f86eea377/_apis/build/builds/2418/logs/166 has: ``` 2019-07-05T01:49:34.1238250Z r? @matthewjasper 2019-07-05T01:49:34.1238312Z ```rust ``` ``` 2019-07-05T01:49:34.1237351Z match DropTemps($cond) { ``` | labels: P-low, T-infra", "label": "low", "label_id": 3} {"id": "rust_62416", "text": "Document whether dereferencing a raw pointer requires alignment | I am referring to the following operation, built into the language: ```rust let x: *const u32 = unimplemented!(); unsafe { *x } ``` I checked all over: The [pointer primitive docs](https://doc.rust-lang.org/std/primitive.pointer.html) don't mention alignment. The [`std::ptr` modu | labels: A-docs", "label": "low", "label_id": 3} {"id": "rust_62420", "text": "align_offset guarantees | The [documentation for `align_offset`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.align_offset) says > If it is not possible to align the pointer, the implementation returns usize::max_value(). It does not give any details of when it might not be possible | labels: T-lang, T-libs-api, A-const-eval, A-miri", "label": "question", "label_id": 4} {"id": "rust_62426", "text": "Cleanup: Consistently use `Param` instead of `Arg` | For example, ideally [`fn visit_arg`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/visit/trait.Visitor.html#method.visit_arm) would be named `fn visit_param` since this is about formal parameters (in function signatures and from the POV inside the function body) instead | labels: A-frontend, E-easy, C-cleanup, A-attributes, A-parser, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62427", "text": "Derive Copy/Clone on generic Union working incorrectly. | The following code reports an error about the value being moved: ``` use std::marker::PhantomData; trait Foo {} struct Bar {} impl Foo for Bar {} #[derive(Copy, Clone)] union U where T: Foo { value1: u32, value2: *const (), phantom: PhantomData<*const T> } fn test() { let a: U", "label": "medium", "label_id": 2} {"id": "rust_62430", "text": "ICE: Rust spins when referencing associated types in `where` clause | The following code broke the the text editor I was editing it in: ## Version rustc 1.35.0 (3c235d560 2019-05-20) ## Minimal test case: ```rust struct MyStruct<'a, 'b, A, B, F>(F, &'a A, &'b B); trait MyTrait { type Input; type Output; } trait MyOtherTrait {}; impl<'a, 'b, A | labels: A-parser, P-medium, T-compiler, regression-from-stable-to-stable, I-compilemem, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62433", "text": "Something weird with const generic resolution in macro_rules | This works, so const generic resolution works through macros (https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e93e583bc759379eae9dac80ed011361) ```rust #![feature(const_generics)] trait Foo {} struct Bar(T); trait Qux {} | labels: A-resolve, T-compiler, C-bug, A-const-generics", "label": "medium", "label_id": 2} {"id": "rust_62439", "text": "1.65x performance regression from 1.35.0 to 1.36.0 | Seeing ~2x (46ms vs 28ms) performance regression after updating 1.35.0 to 1.36.0 (probably due to new HashMap implementation?). **Steps to reproduce** 1. Clone this repo: https://github.com/utter-step/advent-2018 2. `rustup override set 1.35.0 && cargo build -p day-6 --release` 3 | labels: I-slow, T-compiler, regression-from-stable-to-stable, T-libs", "label": "critical_bug", "label_id": 0} {"id": "rust_62440", "text": "Size of `fn` can be either 8 or 0 | There is a discrepancy on the size of a `fn`, depending on if you treat it generically or not: ``` fn foo() { } fn main() { generic(foo); function(foo); } fn generic(f: F) { println!(\"value: {}\", std::mem::size_of_val(&f)); // 0 println!(\"type: {}\", std::mem::size_of::()); | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_62454", "text": "typo in `core::arch::x86_64::_mm_add_epi64` formatting | The `b` var is written with an opening double quote instead of an opening backtick.", "label": "medium", "label_id": 2} {"id": "rust_62456", "text": "ICE: index out of bounds with const generics | https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=4011d663cd9929c5ab2319beda510a6a ```rust #![feature(const_generics)] use std::fmt; struct Builder { items: [&'static str; N], } fn new_builder() -> Builder<{0}> { return Builder{items: []}; } | labels: I-ICE, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_62466", "text": "Increase the arity of tuple with automatic implementation of std traits | Currently up to 12-ary tuple have common traits implemented (PartialEq, Eq, ...). (see https://github.com/rust-lang/rust/blob/master/src/libcore/tuple.rs) In my case, I need to have more than that (I currently use 32, but it may be more). In the end, I expect the tuple to have th | labels: T-lang, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_62471", "text": "Automatically add crate to workspace with `cargo new` | I think it would make sense if there was a flag to `cargo new` such as `--workspace` that would add the new crate to the workspace. There is already workspace detection: ``` ~/rust-comp master $ cargo new --lib abc warning: compiling this new crate may not work due to invalid wor", "label": "medium", "label_id": 2} {"id": "rust_62480", "text": "Internal compiler error with labeled break inside closure | **Toolchain version**: rustc 1.38.0-nightly (dfd52ba6a 2019-07-06) The following code produces internal compiler error ```rust #![feature(label_break_value)] fn main() { let a = 'a: { let a = |x: i32| break 'a; 1 }; } ```
backtrace

``` thread 'rust | labels: A-type-system, I-ICE, P-medium, A-closures, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62482", "text": "Tracking issue for debug_map_key_value | This is a tracking issue for `debug_map_key_value` (https://github.com/rust-lang/rfcs/pull/2696) **Steps:** - [x] Implement the RFC (#60458) - [x] Adjust documentation ([see instructions on rustc-guide][doc-guide]) - [x] Stabilization PR ([see instructions on rustc-guide][stabili | labels: B-RFC-approved, T-libs-api, B-RFC-implemented, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_62486", "text": "The total Rust archive size has intensified recently | **Edit**: > I forgot that with nightly, I also installed clippy, rustfmt, musl target. > The new edit will not contains those. The total Rust archive size has intensified recently. ```console % rustc +nightly-2019-07-07-x86_64-unknown-linux-gnu -V rustc 1.38.0-nightly (dfd52ba6a | labels: T-compiler, I-heavy", "label": "high", "label_id": 1} {"id": "rust_62488", "text": "typo in `core::arch::x86_64::_mm_prefetch` | > * _MM_HINT_T0: Fetch into all levels of the cache hierachy. Should be `hierarchy`", "label": "medium", "label_id": 2} {"id": "rust_62490", "text": "`core::arch::x86_64::_mm_shuffle_ps` input doesn't match official docs | [x86_64::_mm_shuffle_ps](https://doc.rust-lang.org/core/arch/x86_64/fn._mm_shuffle_ps.html) (and by extension [x86::_mm_shuffle_ps](https://doc.rust-lang.org/core/arch/x86/fn._mm_shuffle_ps.html)) have `i32` as the mask type, but the [intel intrinsics guide](https://software.inte | labels: E-easy, T-libs-api, T-compiler, A-docs, A-intrinsics", "label": "low", "label_id": 3} {"id": "rust_62492", "text": "Doc: issue about const_generic_impls_guard link return 404 | The issue link (https://github.com/rust-lang/rust/issues/0) in std doc page https://doc.rust-lang.org/nightly/std/array/trait.LengthAtMost32.html returns 404. Is this issue number mistaken? I suppose that the No.0 issue of rust is talking about const generics is a little ridiculo", "label": "medium", "label_id": 2} {"id": "rust_62496", "text": "install.sh miplaces codegen-backends directory with libdir = \"/lib/something\" | opening here for visibility original issue here https://github.com/rust-lang/rust-installer/issues/93 if someone passes `libdir = \"lib/rust-1.x.x\"` via config.toml install.sh misplaces codegen-backends directory, because `/lib` path is treated as a special case. this code here at | labels: T-bootstrap, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62499", "text": "rustdoc: Trait methods with default implementations are never hidden | ## Background Rustdoc currently hides implementated trait methods behind a _\"Show hidden undocumented items\"_ switch, unless a new doc comment was supplied on the method implementation. For example, consider this code: ```rust pub trait Test { /// This trait method does X... fn f | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_62500", "text": "move async unsafe fn to distinct feature gate | Per @Centril's [comment](https://github.com/rust-lang/rust/issues/62149#issuecomment-508947381), we want to move `async unsafe fn` to its own feature gate: > I would also like to move `async unsafe fn` out of the MVP into its own feature gate because I think a) it has seen little | labels: E-easy, E-mentor, T-compiler, A-async-await, AsyncAwait-Polish", "label": "question", "label_id": 4} {"id": "rust_62501", "text": "Tracking issue for `#!feature(async_unsafe)]` (RFC 2394) | This is a tracking issue for `#![feature(async_unsafe)]` (rust-lang/rfcs#2394). The feature gate provides the `async unsafe fn` syntax. **Steps:** - [ ] Split the feature gate (https://github.com/rust-lang/rust/issues/62500) - [ ] Adjust documentation ([see instructions on rustc- | labels: A-frontend, T-lang, B-unstable, B-RFC-implemented, C-tracking-issue, A-async-await", "label": "question", "label_id": 4} {"id": "rust_62502", "text": "Consider moving std::error::Error to `alloc` | Now that `alloc` is stable, this is a somewhat visible omission from `no_std` contexts. In practice, it being in `std` means that library crates that would otherwise be `no_std` (+ `alloc`) compatible which expose some sort of error type have to either: 1. Skip implementing `std: | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_62504", "text": "ICE (const generics) with const generics in trait | ```rust #![feature(const_generics)] trait HasSize { const SIZE: usize; } impl HasSize for ArrayHolder<{X}> { const SIZE: usize = X; } struct ArrayHolder([u32; X]); impl ArrayHolder<{X}> { pub const fn new() -> Self { ArrayHolder([0; | labels: I-ICE, E-needs-test, T-compiler, C-bug, A-const-generics, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_62506", "text": "ICE on generator type check with a must_use type | ICE is happening on code that awaits a future that has a `Output` type that is `must_use`. Original code: ```rust // src/transport/mod.rs pub trait Broadcast { type Error: std::error::Error; type Future: Future>> + Unpin; fn broadcast(&m | labels: I-ICE, T-compiler, A-async-await, AsyncAwait-Polish", "label": "high", "label_id": 1} {"id": "rust_62516", "text": "libstd: Drop RHEL 5 support, Increase Minimum kernel version to 2.6.27 | The docs currently claim that the minimum Linux kernel version for `libstd` is 2.6.18 (released September 20th, 2006). This is because RHEL 5 used that kernel version. However, RHEL 5 entered ELS on March 31, 2017. Should we continue to support RHEL 5 for `libstd`, or should we i | labels: C-cleanup, O-linux, T-libs-api", "label": "question", "label_id": 4} {"id": "rust_62517", "text": "async fn with elided lifetime causes rustc panic | Code to reproduce: ```rust use futures::Stream; use std::any::Any; async fn foo(x: &str) -> impl Stream> {} ``` and then run `cargo check`... (with full backtrace) ``` thread 'rustc' panicked at 'assertion failed: !erased_self_ty.has_escaping_bound_vars()', sr | labels: I-ICE, P-high, T-compiler, C-bug, A-async-await, AsyncAwait-Polish", "label": "high", "label_id": 1} {"id": "rust_62521", "text": "lifetime-parametric GATs cause ICEs (with feature(generic_associated_types)) | Many people playing with `#[feature(generic_associated_types)]` have noticed that they break very easily when you attempt to use a lifetime formal parameter. Examples follow ## ICE: Region parameter out of range #62326 ([play](https://play.rust-lang.org/?version=nightly&mode=debu | labels: A-lifetimes, I-ICE, P-medium, A-associated-items, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62522", "text": "Is Rc’s and Arc’s data_offset correct? | In the implementation of `Arc`, we find: https://github.com/rust-lang/rust/blob/09ab31bc64f4ede9f9498440cb4225c173767c1e/src/liballoc/sync.rs#L258-L269 https://github.com/rust-lang/rust/blob/09ab31bc64f4ede9f9498440cb4225c173767c1e/src/liballoc/sync.rs#L2288-L2304 (And similarly | labels: T-lang, T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_62524", "text": "compiler panic: \"byte index 10 is not a char boundary\" | ``` $ rustc -Vv rustc 1.36.0 (a53f9df32 2019-07-03) binary: rustc commit-hash: a53f9df32fbb0b5f4382caaad8f1a46f36ea887c commit-date: 2019-07-03 host: x86_64-apple-darwin release: 1.36.0 LLVM version: 8.0 $ echo Zm4gbWFpbigo2Lw= | base64 -D > main.rs $ rustc main.rs error: this fi | labels: I-ICE, A-parser, A-Unicode, P-medium, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_62525", "text": "missing symbol in codegen backend when built with llvm-libunwind | When enabling llvm-libunwind, I get this error while building stage2 compiler: ``` error: couldn't load codegen backend \"/var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/codegen-nightly-backends/libr | labels: A-LLVM, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62529", "text": "ICE rink: higher-rank trait bound (HRTB) `for<'a> ...` hits OutputTypeParameterMismatch in librustc/traits/codegen | I have seen many `OutputTypeParameterMismatch` ICEs filed, so I decided to try to make a single representative issue for all of them. * Its possible that not all of these share the same root cause. But until I see a more fine grain way to categorize them, I'm going to at least tr | labels: I-ICE, A-trait-system, P-medium, T-compiler, C-bug, A-lazy-normalization", "label": "high", "label_id": 1} {"id": "rust_62530", "text": "Account for coercions in trait resolution? | This came up in https://github.com/rust-lang/rust/pull/62528, see β€œJoining strings with `char`”. Reduced test case: ```rust fn takes_str(_x: &str) {} fn takes_type_parameter(_x: T) where T: SomeTrait {} trait SomeTrait {} impl SomeTrait for &'_ str {} impl SomeTrait for char { | labels: A-trait-system, T-lang, A-coercions", "label": "medium", "label_id": 2} {"id": "rust_62531", "text": "Missed optimization on array comparison | The godbolt link: https://godbolt.org/z/dc9o3x I think this snippet should just return `true`: ```rust pub fn compare() -> bool { let bytes = 12.5f32.to_ne_bytes(); bytes == if cfg!(target_endian = \"big\") { [0x41, 0x48, 0x00, 0x00] } else { [0x00, 0x00, 0x48, 0x41] } } ``` The ge | labels: A-LLVM, I-slow, C-enhancement, A-codegen, E-needs-test, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62536", "text": "ICE: \"can't hash a TyVid\" when failing to infer a const generic | A clean rust project on the latest nightly rustc with just this `src/main.rs`: ```rust #![feature(const_generics)] struct S([T; N]); fn f(x: T) -> S { panic!() } fn main() { f(0u8); } ``` produces the following error on cargo check/bu | labels: I-ICE, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_62539", "text": "diagnostic for naive recursive async functions is really unfriendly | The following Rust source ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=137001df1ae7afa5b2b4b0fe649b8ed6)): ```rust #![feature(async_await)] async fn foo(n: usize) { if n > 0 { foo(n - 1).await; } } fn main() { } ``` gives the error: ``` e | labels: T-compiler, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2} {"id": "rust_62540", "text": "ICE with turbofish \"no type for node\" | Compiler panics when using turbofish and `.parse()` I tried this code: ```rust use std::str::FromStr; struct Six(); impl FromStr for Six { type Err = String; fn from_str(s: &str) -> Result { if s.len() != 6 { return Err(format!(\"Incorrect length {}\", s.len())); }", "label": "high", "label_id": 1} {"id": "rust_62546", "text": "internal compiler error: Error constructed but not emitted | I see the following error on the `beta` and `nightly` channels, but not on `stable`: ``` $ echo \"pub t(#\" > main.rs $ rustc main.rs error: this file contains an un-closed delimiter --> main.rs:1:9 | 1 | pub t(# | - ^ | | | un-closed delimiter error: internal compiler error: Error | labels: I-ICE, A-parser, P-high, T-compiler, regression-from-stable-to-beta, E-needs-bisection", "label": "critical_bug", "label_id": 0} {"id": "rust_62552", "text": "Paragraphs in block doc comments are broken | I returned to a crate of mine for the first time in quite a while and was perplexed to see that all of the paragraphs in my doc comments were gone, and instead had been turned into line breaks (so all of the paragraphs were squashed together). Upon investigation I discovered that | labels: T-rustdoc, C-bug", "label": "question", "label_id": 4} {"id": "rust_62553", "text": "CString::into_raw() trigger miri | ```rust use std::ffi::CString; fn main() { let _hello = CString::new(\"Hello\") .expect(\"CString::new failed\") .into_raw(); } ``` This simple code should not trigger any error, except a leak of course. But miri report an error before: ```none error[E0080]: Miri evaluation error: tr | labels: A-FFI, A-miri", "label": "medium", "label_id": 2} {"id": "rust_62554", "text": "ICE: thread 'rustc' panicked at 'capacity overflow' | I'm seeing the following error on the `nightly` channel, but not on `stable` or `beta`: ``` $ echo \"fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {\" > main.rs $ rustc main.rs error: this file contains an un-closed delimiter --> main.rs:1:89 | labels: I-ICE, P-medium, regression-from-stable-to-nightly, T-compiler, I-compilemem, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62558", "text": "Tools are not available on cross compiled platforms since #61861 | Moved from https://github.com/rust-lang/rust-clippy/issues/4267 #61861 was merged in #61962, since then Rustfmt fails to build when cross compiling which is the case for almost all non Tier 1 platforms. Clippy and RLS are failing with similar error. Error on `aarch64-unknown-linu | labels: O-Arm, A-cross, regression-from-stable-to-stable, O-freebsd, T-bootstrap, T-infra", "label": "critical_bug", "label_id": 0} {"id": "rust_62562", "text": "serde no longer builds with latest rustc (master) | Looks like something that landed in the commit range https://github.com/rust-lang/rust/compare/0b680cfce544ff9a59d720020e397c4bf3346650...d4e15655092d1bdae79619eb0ff2c3cb5468fc36 broke [building serde](https://travis-ci.com/rust-lang/miri/jobs/214779163): ``` error[E0433]: failed | labels: A-resolve, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62563", "text": "test triagebot issue body commands | This appears to work in a test repo (https://github.com/foreign-rust-tester/triagebot-test/issues/6) but didn't work earlier today (https://github.com/rust-lang/rust/issues/62558). @rustbot modify labels: T-dev-tools A-rustbuild | labels: T-bootstrap, T-dev-tools", "label": "medium", "label_id": 2} {"id": "rust_62566", "text": "include material on async fn in the Rust reference | This is a \"rust-lang/rust\" placeholder for https://github.com/rust-lang-nursery/reference/issues/634, since that exists in another repo/org. | labels: T-lang, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2} {"id": "rust_62567", "text": "Compile times suddenly extremly high | Since one of my latest changes to my project, the compile times have been extremly high (jumping to >1min from about 15secs). I tried compiling the lib of this crate (it is to large to post here): https://github.com/fabianvdW/ChessInRust with `cargo build--release --lib` Compiler | labels: A-LLVM, I-compiletime, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62570", "text": "Async blocks are leaky about wording wrt. `?` in diagnostics | E.g. consider: ```rust #![feature(async_await)] fn foo() { let x = async move { Err(())?; 1 }; } ``` which yields the diagnostic: ``` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`) | labels: A-diagnostics, T-compiler, A-async-await, AsyncAwait-Polish, AsyncAwait-Triaged, F-on_unimplemented", "label": "medium", "label_id": 2} {"id": "rust_62571", "text": "rustdoc crashes parsing strange doc-comment on 1.36 | After upgrading to 1.36 rustdoc is crashing like this when run on my crate: ``` thread 'rustc' panicked at 'unexpected item body MaybeEmphasis(2, true, false)', /work/toolchain/packages/rust/rustc-1.36.0-src/vendor/pulldown-cmark/src/parse.rs:2418:14 note: Some details are omitte | labels: T-rustdoc, I-ICE, C-bug", "label": "high", "label_id": 1} {"id": "rust_62572", "text": "Pretty-printing support for Rust generators | Support printing Rust generators in a way that looks more like enums. Generators (as of #59897) are represented in Rust as variant layouts with some extra fields on the outer layout. These extra fields (which are upvars, captured from the environment of the generator closure) see | labels: A-debuginfo, C-enhancement, T-compiler, A-async-await, AsyncAwait-Triaged", "label": "question", "label_id": 4} {"id": "rust_62573", "text": "\"overflow evaluating the requirement\" documenting synstructures in rustdoc beta, but not rustdoc stable nor rustc beta | I'm in a project which depends on both `syn` and `synstructures` crates. Using rustc `1.37.0-beta.2` or `rustc 1.38.0-nightly (78ca1bda3 2019-07-08)`, I can no longer document this crate with its dependencies. The following error occurs: ```rust $ cargo doc Downloaded synstructur | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_62576", "text": "Cross-compile to windows using clang fails | Trying to cross-compile to Windows (`x86_64-pc-windows-gnu`) with clang and lld fails as it tries to use the `--enable-long-section-names` which lld does not have. ``` $ cargo build --target x86_64-pc-windows-gnu --release […] error: linking with `/opt/llvm-mingw/bin/x86_64-w64-m | labels: A-linkage, A-LLVM, A-cross, T-compiler, O-windows-gnu, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62579", "text": "ICE: \"non-Scalar ConstValue encountered in super_relate_consts\" with const generics | The following code: ```rust #![feature(const_generics)] struct NoMatch; fn foo() -> bool { return true } fn main() { foo::<{NoMatch}>(); } ``` Produces an ICE: ``` error: internal compiler error: src/librustc/ty/relate.rs:598: non-Scalar ConstValue encountered i | labels: I-ICE, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_62582", "text": "rustc wrongly reports conflicting implementation | **`String` is not a `Copy`, there should be no conflicts.** ```rust struct S(V); trait T { fn m(&self) -> V; } impl T for S { fn m(&self) -> V { self.0 } } impl T for S { fn m(&self) -> String { String::from(\"String\") } } ``` ``` error[E0119]:", "label": "medium", "label_id": 2} {"id": "rust_62589", "text": "Wrong linker order on Linux produces error. | **Background** _Same background as #62588._ We have a Rust project (lets call it `dylib`) where we want to produce a shared library (.dll, .dylib, .so) for various platforms. As part of the build process we also want to verify the prov | labels: A-linkage, O-linux, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_62590", "text": "Regression with macros in types on serde_derive | serde_derive 0.0.94 compiles just fine with 2019-06-06's nightly, but is broken with 2019-06-11: ``` error[E0433]: failed to resolve: unresolved import --> src/internals/ast.rs:142:44 | 142 | variants: &'a Punctuated, | ^^^^^^^^^ | | | unresolved import | | labels: regression-from-stable-to-nightly", "label": "critical_bug", "label_id": 0} {"id": "rust_62591", "text": "rust-cssparser doesn't compile anymore, complaining about `syn::Token!` | The latest nightly doesn't compiler [cssparser](https://github.com/servo/rust-cssparser). The error message is the following: ``` error[E0433]: failed to resolve: unresolved import --> build/match_byte.rs:48:31 | 48 | input.parse::()?; | ^^^^^^^^^^^^^^ | | | unres", "label": "low", "label_id": 3} {"id": "rust_62601", "text": "Meaningless usage of comment decorators | We have a number of places in the code base that use 'comment decorators' i.e. from `rustlib/src/rust/src/libcore/option.rs` ``` ///////////////////////////////////////////////////////////////////////////// // Type implementation ////////////////////////////////////////////////// | labels: E-easy, C-cleanup, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62609", "text": "Update error message for `self` | I did some search and find no similar issue, so here is my report: Compile the following code: ```rust struct Data; impl Data { fn rc(self: &std::rc::Rc) { println!(\"&rc\"); } } ``` Give the error: ``` error[E0658]: `&std::rc::Rc` cannot be used as the type of `self` w | labels: C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62611", "text": "LLVM ERROR: out of memory with latest nightly (Windows 32bit) | I am trying to upgrade rust nightly in a project of mine and getting `out of memory` errors due to that, only on Windows though. - old rust version: rustc 1.37.0-nightly (0dc9e9c10 2019-06-15) - new rust version: rustc 1.38.0-nightly (0b680cfce 2019-07-09) Build log of the failur | labels: A-LLVM, T-compiler, I-compilemem, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62614", "text": "indirect_structural_match lint misfiring on enum variant unused in const item | (Spawned off of https://github.com/rust-lang/rust/issues/62411#issuecomment-510604193) Consider this code ([play](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=449daf68183e9566fc106b070fdaeb10)): ```rust struct Sum(u32, u32); impl PartialEq for Sum { fn | labels: A-lints, P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62616", "text": "[1.38] rayon failing test | * rayon-1.1.0: [start](https://crater-reports.s3.amazonaws.com/beta-1.37-1/1.36.0/reg/rayon-1.1.0/log.txt) v. [end](https://crater-reports.s3.amazonaws.com/beta-1.37-1/beta-2019-07-04/reg/rayon-1.1.0/log.txt); cc @cuviper Haven't actually attempted to reproduce this locally but l | labels: T-libs-api, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_62617", "text": "[1.38] Placement new syntax no longer parses | root: mbox 0.3.1; cc @kennytm causes: * resin-os/healthdog-rs: [start](https://crater-reports.s3.amazonaws.com/beta-1.37-1/1.36.0/gh/resin-os.healthdog-rs/log.txt) v. [end](https://crater-reports.s3.amazonaws.com/beta-1.37-1/beta-2019-07-04/gh/resin-os.healthdog-rs/log.txt); cc ` | labels: A-parser, T-lang, regression-from-stable-to-beta", "label": "question", "label_id": 4} {"id": "rust_62618", "text": "Dependency check of the tidy tool should verify the license | Currently, in the dependency-check of the tidy tool, dependencies having an incompatible license are white-listed, and the actual license is documented in a comment. Instead, the actual license should be documented in code, and the tool should check that the license is actually c | labels: A-testsuite, C-enhancement, T-infra", "label": "low", "label_id": 3} {"id": "rust_62619", "text": "Dependency check of the tidy tool should verify libstd dependencies | There is a documentation comment explicitly saying that it is **crucial** for libcore,liballoc,libstd not to depend on any crate with incompatible licenses, yet a couple of lines after there is an exemption that does precisely this: https://github.com/rust-lang/rust/blob/master/s | labels: A-runtime, A-testsuite, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62620", "text": "Code under the 2-clause-BSD license is not documented as a compatible license for the Rust runtime | The 2-clause-BSD license is not documented in the tidy script as being a compatible license for the rust runtime dependencies. We used to ship BSD licensed code as part of libstd until recently: https://github.com/rust-lang/rust/commit/0b85b64d6b70b100f6222a96ff2337c302b386f1#dif | labels: A-testsuite, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62621", "text": "Function items will not coerce to function pointers when inferring the type of a generic function argument with a trait bound | Function items do not coerce to fn pointer types when they are passed as a generic function parameter with a trait bound. A manual cast or type annotation is required. trait Foo {} impl Foo for fn() {} fn non_generic(_f: fn()) {} fn generic_without_bound(_f: F) {} fn generic_w | labels: T-lang, C-feature-request, A-coercions, needs-rfc", "label": "medium", "label_id": 2} {"id": "rust_62625", "text": "Add Option::err_or* to complement Option::ok_or* | We already have `Option::ok_or` and `Option::ok_or_else` to go from `Option` to `Result`, but we have no method to perform the opposite conversion from `Option` to `Result<_, E>`. (Eventual) tracking issue for #62624. | labels: T-libs-api, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_62628", "text": "Pretty-printing/tokenization of `final` has changed to `r#final` | Given a procedural macro like: ```rust extern crate proc_macro; use proc_macro::*; #[proc_macro_attribute] pub fn foo(a: TokenStream, b: TokenStream) -> TokenStream { assert_eq!(a.to_string(), \"final\"); return b.into_iter().collect(); } ``` and a consumer like: ```rust #[foo::foo | labels: A-parser, A-macros, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62630", "text": "Odd type mismatch error? | I got the following while working on #58281. I messed up the condition of an `if` (so that its type was `usize` instead of `bool`) as the error correctly points: ```console Compiling rustc_mir v0.0.0 (/nobackup/rust2/src/librustc_mir) error[E0308]: mismatched types --> src/librus | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62631", "text": "rustc panics when trying to get session directory when building project on ramdisk | Seems similar to #52440, but no cross platform weirdness is in play. Project builds fine on a normal C drive on windows, but when the same repo is cloned to a ramdisk (created by imdisk driver) on windows, rustc panics. First incremental compilation gives an error so it appears t | labels: I-ICE, T-compiler, A-incr-comp, C-bug", "label": "high", "label_id": 1} {"id": "rust_62632", "text": "Bring back suggestion for splitting `<-` in a comparison | ```rust fn main() { if x<-1 { } } ``` produces: ``` error: expected `{`, found `<-` ``` It would be nice if it produced a suggestion to split it up: ```rust if x < -1 { ``` (This [used to happen](https://github.com/rust-lang/rust/pull/60803#discussion_r303081575), but was broken | labels: E-easy, C-enhancement, A-diagnostics, T-compiler", "label": "question", "label_id": 4} {"id": "rust_62633", "text": "Tracking issue for Option::expect_none(msg) and unwrap_none() | ```rust impl Option { pub fn expect_none(self, msg: &str); pub fn unwrap_none(self); } ``` **Steps:** - [x] Merge the implementation (#62596) - [ ] Stabilization PR - [ ] Update the `must_use` message on `is_none` (per https://github.com/rust-lang/rust/pull/6243 | labels: T-libs-api, B-unstable, C-tracking-issue, finished-final-comment-period, disposition-close, A-result-option", "label": "medium", "label_id": 2} {"id": "rust_62637", "text": "Running out of RAM during compilation | Hi Incorrectly closing the parentheses around an if expression causes the compiler to be stuck in endless recursion (probably), causing the computer to run out of memory. I encountered this bug while trying to return `Some(if cond { ... } else { ... })` from a function by acciden | labels: P-medium, T-compiler, regression-from-stable-to-stable, I-compilemem, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62642", "text": "Suggest removal of `.as_str()` when called on a `&str` | Given ``` fn make_lipographic(banned: char, line: &str) -> String { line.as_str().chars().filter(|&c| c != banned).collect() } fn main() { let passage = String::from(\"If Youth, throughout all history, had had a champion to stand up for it\"); assert_eq!(make_lipographic('e', &pass | labels: C-enhancement, A-diagnostics, P-low, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_62645", "text": "Nonsensical error message with const generics and std::mem::sized_of | The following code: ```rust #![feature(const_generics)] trait IsZst { type ZST; } impl IsZst for T where T: Sized { type ZST = ZstHelper<{std::mem::size_of::() == 0}>; } struct ZstHelper; ``` produces the following error: ``` error[E0277]: the size for | labels: A-diagnostics, T-compiler, C-bug, A-const-generics, requires-nightly, F-on_unimplemented", "label": "medium", "label_id": 2} {"id": "rust_62648", "text": "Rustbuild rebuilt when checkout branch and checkout back | For example, when I am on my branch `feature`, I checkout to `master` and check back to `feature`, rustbuid rebuilt from stage 0. | labels: T-bootstrap, T-infra", "label": "medium", "label_id": 2} {"id": "rust_62649", "text": "ICE in incr comp after s/trait/struct/: src/librustc/dep_graph/graph.rs:688: DepNode Hir(...) should have been pre-allocated but wasn't. | Hi, I just got a crash on Travis, on stable (1.35.0), when enabling edition=\"2018\" Commands ran by Travis: ``` git clone https://github.com/fflorent/nom_locate.git cd nom_locate git checkout -qf 77e08c3bfb1cadee8176f96ea78ba8c68308d9c8 cargo build --no-default-features --features | labels: I-ICE, P-high, T-compiler, regression-from-stable-to-stable, A-incr-comp, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62650", "text": "diagnostics: suggest \"Self::\" on missing type not found in trait definition | ````rust trait A { type Bla; fn to_bla(&self) -> Bla; } ```` yields ```` error[E0412]: cannot find type `Bla` in this scope --> src/main.rs:3:25 | 3 | fn to_bla(&self) -> Bla; | ^^^ not found in this scope error: aborting due to previous error ```` it would be helpful to suggest | labels: A-diagnostics, A-associated-items, A-suggestion-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_62652", "text": "\"unresolved import\" message makes little sense with 2018 edition | ``` $ cargo check error[E0432] unresolved import `foo` | x | foo::{Bar, Baz}, | ^^^ maybe a missing `extern crate foo;`? ``` The above message makes little sense with the 2018 edition of Rust, since `extern crate` isn't required anymore. | labels: E-easy, A-diagnostics, E-needs-test, P-medium, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_62654", "text": "Unhelpful error message for lifetime parameter E0495 | Code to reproduce ``` #![feature(async_await)] use std::future::Future; struct Test; async fn foo(_: &Test) {} impl Test { fn test(&self) -> Box + 'static> { Box::new(async { foo(self).await }) } } ``` Error message: ``` Compiling playground v0.0.1 (/playgro | labels: C-enhancement, A-diagnostics, A-lifetimes, T-compiler, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_62658", "text": "ICE: assertion failed: `(left == right)` in type_of.rs | I just ran into this ICE: ``` thread 'rustc' panicked at 'assertion failed: `(left == right)` left: `Size { raw: 404 }`, right: `Size { raw: 400 }`', src/librustc_codegen_llvm/type_of.rs:148:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: i | labels: A-codegen, I-ICE, O-Arm, regression-from-stable-to-nightly, P-high, T-compiler", "label": "critical_bug", "label_id": 0} {"id": "rust_62660", "text": "ICE with wrong method receiver as second parameter | The following code ([on compiler explorer](https://godbolt.org/z/_Qo2zy)) leads to an ICE: ```rust struct Foo; impl Foo { // mind the missing `>` of the receiver pub fn foo(_: i32, self: Box$ rustc --version >rustc 1.36.0 (a53f9df32 2019-07-03) >$ cat main.rs >fn main() >{ > println!(\"Hello, world!\"); >} > >$ rustc main.rs >$ ls -la >total 528 >drwxr-xr-x 4 zzy staff 128 Jul 13 12:21 . >d", "label": "medium", "label_id": 2} {"id": "rust_62676", "text": "./x.py build OSError: [Errno 2] No such file or directory | Trying to build from source on Ubuntu 18.04 x64 ``` Traceback (most recent call last): File \"./x.py\", line 11, in bootstrap.main() File \"/tmp/z/rust/src/bootstrap/bootstrap.py\", line 866, in main bootstrap(help_triggered) File \"/tmp/z/rust/src/bootstrap/bootstrap.py\", li", "label": "medium", "label_id": 2} {"id": "rust_62677", "text": "e0308 possibly confusing error message | I got the following error today: ``` error[E0308]: mismatched types --> src/util.rs:13:33 | 13 | fn from_str(input: &str) -> Result { | -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found () | | | this function's body doesn't return | = no | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62686", "text": "Add tests for overlapping explicitly dropped locals in generators | #61922 allows us to overlap `x` and `y` in this example: ```rust fn gen() { let x = [0u8; 1024]; yield; drop(x); let y = [0u8;1024]; yield; drop(y); } ``` Come to think of it, this is a pretty important behavior that I should have added an explicit test for. | labels: E-needs-test, T-compiler, A-coroutines", "label": "medium", "label_id": 2} {"id": "rust_62691", "text": "Suboptimal niche usage within the fields of a variant. | On x86_64, this prints the values in comments: ```rust pub enum Option2 { Some(A, B), None } fn main() { use std::mem::size_of; dbg!(size_of::>>()); // = 16 dbg!(size_of::>>()); // = 16 dbg!(size_of::

Backtrace: ``` error: internal compiler error: src\\librustc\\ich\\impls_ty.rs:213: ty::TyKind::hash_stable() - can't hash a TyVi | labels: I-ICE, T-compiler, C-bug, E-needs-mcve, requires-nightly, F-const_generics", "label": "question", "label_id": 4} {"id": "rust_62706", "text": "Failed in tidy due to submodule | In the latest rust-lang/rust master, we see many tidy (`x.py test src/tools/tidy`) errors probably due to stdarch(stdsimd). Errors, for example: - CR characters - line longer than 100 chars - tab characters I already ran `x.py clean` but the issue hasn't been fixed.", "label": "medium", "label_id": 2} {"id": "rust_62708", "text": "ICE using associated constant in generic type | I'd like to use an associated constant when telling `arrayvec::ArrayVec` how big the underlying array should be and encountered an ICE while running the following code: ```rust use arrayvec::ArrayVec; pub struct MultiDriver { drivers: ArrayVec<[Driver; MultiDriver:: | labels: I-ICE, A-trait-system, P-medium, A-associated-items, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62711", "text": "Which is accessor method of MetadataExt? | https://github.com/rust-lang/rust/blob/4b65a86ebace8600c8e269e8bfe3365cdc460e68/src/libstd/os/linux/fs.rs#L36-L41 | labels: O-linux, C-enhancement, A-docs", "label": "low", "label_id": 3} {"id": "rust_62715", "text": "`miri` no longer builds after rust-lang/rust#62704 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62704, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Mark-Simulacrum, do you think you would | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62717", "text": "ICE \"no ImplicitCtxt stored in tls\" in Servo on Windows and macOS | Compiling Servo with rustc 1.38.0-nightly (4b65a86eb 2019-07-15) works fine on Linux. On a Windows or macOS host the compiler panics on the `script` crate: ```rust thread 'rustc' panicked at 'no ImplicitCtxt stored in tls', src\\libcore\\option.rs:1065:5 stack backtrace: 0: std::sy | labels: I-ICE, P-high, T-compiler, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62718", "text": "Send trait bound failure error message doesn't refer to Send at all | If a trait method expects a `Future` to be `Send` but we try to use it for a `Future` that doesn't implement `Send`, the compiler error message doesn't mention the missing `Send` trait at all, which makes it very hard to debug the issue. Example: https://play.rust-lang.org/?versi | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62719", "text": "String truncate assertion failed with some chars | This assertion failed when using a specific charset : `liballoc/string.rs:1557` Step to reproduce : ```rust fn main() { let mut s = \"γƒœγƒ«γƒ†γƒƒγ‚―γ‚Ή\".to_string(); s.truncate(4); } ``` ## Meta `rustc --version --verbose`: ``` rustc 1.36.0 (a53f9df32 2019-07-03) binary: rustc commit-hash: a | labels: C-enhancement, A-diagnostics, T-libs-api", "label": "low", "label_id": 3} {"id": "rust_62721", "text": "Why is Rust free? | Hello Rust developers, I have tried searching on rust-lang.org and related websites. I've searched wikipedia and the Internet. But I can't find the answer to my question: Why is Rust free? May I ask if you could add that answer to rust-lang.org? Just in case other people have tha", "label": "question", "label_id": 4} {"id": "rust_62724", "text": "Improving error for unnecessary parentheses in `for` loop head | The following code: ```rust fn main() { let v = vec![1,2,3]; for (x in v) { } } ``` leads to this error: ``` error: expected one of `)`, `,`, or `@`, found `in` --> src/main.rs:4:12 | 4 | for (x in v) { } | ^^ expected one of `)`, `,`, or `@` here ``` ([playground](https://play.r | labels: C-enhancement, A-diagnostics, A-parser, P-low, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_62726", "text": "Tracking issue for io_slice_advance | This is a tracking issue for `IoSlice::{advance, advance_slices}` and `IoSliceMut::{advance, advance_slices}`. Feature gate: #![feature(io_slice_advance)]. Steps: - [x] Implement the RFC. * #62987 * #85802 - [ ] FCP - [ ] Stabilization PR. Current API additions: ```rust impl<'a> | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, A-io", "label": "low", "label_id": 3} {"id": "rust_62731", "text": "core::fmt::Formatter needs setter methods | If you're given a format string when formatting a struct there's no way to 1) read some of that data 2) decide how to format the struct fields. 3) have those fields then format themselves according to an alternate `Formatter` based on your decision above. **Example:** if you get | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_62739", "text": "rustc-guide submodule issues | Recent PR (#62733) failed due to some issues with updating the rustc-guide submodule. It's not clear exactly the extent of what's wrong, but here are some issues I see: - I can't find anything that actually runs the rustc-guide tests. - Running them locally, they fail with bad li | labels: T-compiler, T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62741", "text": "rustdoc doesn't render links in Trait Implementations sections | https://doc.rust-lang.org/nightly/std/iter/struct.Flatten.html#method.scan ![image](https://user-images.githubusercontent.com/15225902/61345900-28c8b300-a881-11e9-8454-90b780310685.png) https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.scan ![image](https://us | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_62742", "text": "ICE: Generic type alias to invalid type crashes during type check on latest stable | This also crashes on the latest nightly [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0d49e84d11fd24aa8d24c1da1be6a428) ```rust use std::marker::PhantomData; fn _alias_check() { WrongImpl::foo(0i32); // crash WrongImpl::<()>::foo(0i32); // f | labels: I-ICE, A-trait-system, P-high, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62743", "text": "_mm_storeu_si16 and _mm_storeu_si64 are missing but not documented as such | * [_mm_storeu_si16](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#=undefined&text=_mm_storeu_si16&techs=SSE) * [_mm_storeu_si64](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#=undefined&text=_mm_storeu_si64&techs=SSE) They're both missing from `cor | labels: O-x86_64, T-libs-api, A-SIMD, O-x86_32", "label": "medium", "label_id": 2} {"id": "rust_62747", "text": "Docker build stopped due to lot of memory usage during dependencies compilation | Hello, I'm currently face to a big issue for me. Trying to build the docker image of this project: https://github.com/FTV-Subtil/rs_http_worker I cannot achieve it as lot of memory is used, so workers swap a lot and build take more than 1h. Do you have some ideas to optimise buil", "label": "medium", "label_id": 2} {"id": "rust_62750", "text": "core: undefined symbol: Z3_mk_config\" | repo is @ bf16480f9cf124630f4a4ffc6d8a57b72fbd5ce9 ```` Compiling core v0.0.0 (/home/matthias/vcs/github/rust/src/libcore) error: couldn't load codegen backend \"/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backe | labels: A-linkage, A-LLVM, A-codegen, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62751", "text": "ICE while switching a type definition between enum and trait | I have observed an ICE when I run `cargo check`. At that time I was switching a type definition between `enum` and `trait` on my own type. At first I was using a trait: ```rust trait Block { // ... } ``` on implementing it further I realized that I needed to use GAT, so I switche | labels: I-ICE, T-compiler, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_62753", "text": "LinuxTools builder: sccache isn't used | The compiler time of [LinuxTool builds](https://dev.azure.com/rust-lang/rust/_build/results?buildId=3593&view=logs) are nearly 4 hours, which is due to the lack of sccache not being used. I believe that PRs don't have access to the same environment variable group as the auto buil | labels: T-infra", "label": "medium", "label_id": 2} {"id": "rust_62754", "text": "LinuxTools builder: TOOLSTATE_REPO is undefined | This may or may not have the same fix as https://github.com/rust-lang/rust/issues/62753, but the LinuxTools PR builder doesn't have access to the same variables as the auto builders, which means the docker image fails at the very end (https://dev.azure.com/rust-lang/rust/_build/r | labels: T-infra", "label": "medium", "label_id": 2} {"id": "rust_62762", "text": "STATUS_ACCESS_VIOLATION on 'index out of bounds' Windows 7 with lto and avx | With avx and lto enabled, index out of bounds causes a STATUS_ACCESS_VIOLATION instead of a panic. Initially encountered this problem in a program using rand::thread_rng() but narrowed down to a simpler test case found in issue #51794. I tried this code: ``` fn main() { let x = [ | labels: O-windows, P-high, T-compiler, I-unsound", "label": "critical_bug", "label_id": 0} {"id": "rust_62763", "text": "hashbrown's trait implementations appear in std docs | Perhaps this is a known issue, but I've noticed that since `hashbrown` was integrated into the standard library, impls from that crate now [show up under the 'Implementations on Foreign Types' section of the trait docs](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html#f | labels: T-rustdoc, A-collections, T-libs-api, A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_62767", "text": "ICE when use-ing enum variant after glob-importing same-named enum | [playpen](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=17237a55fd54a2981a6113425362cfce) Reproduction code: ```rust mod foo { pub enum Foo { Foo(i32), } } use foo::*; use Foo::Foo; ``` ``` thread 'rustc' panicked at 'assertion failed: directive.imported | labels: A-resolve, I-ICE, P-medium, T-compiler, C-bug, glacier", "label": "high", "label_id": 1} {"id": "rust_62768", "text": "\"Foo is ambiguous\" even though it's not | [playpen](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=75fda319e5fcd1be7259ee46c608a710) Given the following code: ```rust mod foo { pub enum Foo { Foo(i32), } } use foo::*; use Foo::*; ``` The compiler claims, that the `Foo` in `use Foo::*` could eithe | labels: A-resolve, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62770", "text": "Minor 1.36 rustdoc regression: \\] after a link is not treated as an escape | A minor change in behavior between 1.35.0 and 1.36.0. Repro example here: ``` /// \\[This escapes both brackets\\] /// \\[[This escapes only the left bracket as of 1.36.0](https://www.google.com/)\\] pub fn example() { } ``` Run a standard `cargo doc`. In 1.36.0, the link will displa | labels: T-rustdoc, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62773", "text": "str::trim_start_matches and similar should not trust Searcher to return valid indices | For example, https://github.com/rust-lang/rust/blob/bc2e84ca0939b73fcf1768209044432f6a15c2e5/src/libcore/str/mod.rs#L3748, and the equivalent in trim_end_matches. The functions on Searcher that return these are not unsafe, and *someday* could be implemented outside the stdlib. Al", "label": "medium", "label_id": 2} {"id": "rust_62775", "text": "test cases under run-pass directory are not running | With the change in function should_run_successfully() of commit 54337fab39f4c610bd5e5c51cea6a965e7bd7cdb: - RunPass => true, - Ui => self.props.pass_mode == Some(PassMode::Run), + RunPass | Ui => self.effective_pass_mode() == Some(PassMode::Run), The test cases under run-pass dir | labels: A-testsuite, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62776", "text": "Building core on thumbv6-none-eabi fails with \"LLVM ERROR: invalid symbol redefinition\" | In my project I'm using xargo to build libcore. Perhaps appropriately, the compiler warns it may crash and then promptly crashes: ``` warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> /home/gui/.rustup/toolchains/nightly-x86_64-unknown-li | labels: A-LLVM, A-codegen, T-compiler, C-bug, A-const-generics", "label": "medium", "label_id": 2} {"id": "rust_62779", "text": "Cross-crate re-export produces invalid rustdoc for impl Trait | In a cross-crate reexport of an `impl Trait`-accepting function, rustdoc formats it in a wrong way which is not even valid Rust. Let `crate1` be: ```rust pub trait MyTrait {} pub fn accepts_impl(_t: impl MyTrait) {} ``` Let `crate2` be: ```rust pub use crate1::{MyTrait, accepts_i | labels: T-rustdoc, A-impl-trait, C-bug", "label": "low", "label_id": 3} {"id": "rust_62780", "text": "Tests related to debuginfo-both failing on sparc64 | During the past releases, a lot of bugs in the sparc64 backend have been fixed so that we're down to 59 failing tests now. One of the tests that have been failing for a long time now (don't know whether they ever passed) are ```debuginfo-both```: ``` test [debuginfo-both] debugin | labels: A-testsuite, A-debuginfo, O-SPARC, C-bug", "label": "question", "label_id": 4} {"id": "rust_62781", "text": "Recent nightly versions break thumb* targets | Hey all, I've noticed in nightly-2019-07-18, rustc has begun producing symbols in the `.ARM.exidx` region, which it did not previously do. As our standard linker script does not have a linker rule for this region, building fails with with the following error: ``` = note: rust-lld | labels: A-LLVM, O-Arm, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62785", "text": "Undefined symbol _fltused when compiling to x86_64-unknown-uefi | Recent nightlies give the following linker error when trying to compile with the `x86_64-unknown-uefi` target: ``` error: linking with `rust-lld` failed: exit code: 1 | = note: \"rust-lld\" \"-flavor\" \"link\" \"/NOLOGO\" \"/NXCOMPAT\" \"/nodefaultlib\" \"/entry:efi_main\" \"/subsystem:efi_app | labels: A-linkage, O-x86_64, P-high, T-compiler, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62790", "text": "Miri/CTFE fails when const generic is used as value | Miri/CTFE fails to execute code where a const generic parameter is used as a value, such as what `try_from` for arrays does these days: ```rust #![feature(const_generics)] fn len<'a, T, const N: usize>(_array: &'a [T; N]) -> usize { N } fn main() { const N: usize = 16; type Array | labels: C-bug, A-const-eval, A-miri, A-const-generics, requires-nightly, F-const_generics", "label": "question", "label_id": 4} {"id": "rust_62794", "text": "Document that `Debug` output of structures is unstable | Pretty printed structures for `cfg!(windows)` have trailing commas, which is inconsistent with the debug output format documentation and output on non-windows platforms. ```rust use std::fmt; struct Foo { bar: u32, baz: Option } impl fmt::Debug for Foo { fn fmt(&self, fmt: & | labels: E-easy, C-enhancement, T-libs-api, A-docs", "label": "low", "label_id": 3} {"id": "rust_62795", "text": "compile cdylib is ok,but staticlib can't link to __cxxframehandler3 | env : windows10 compile with cdylib is ok,just copy dll to windows path but with staticlib , can build success , but can't link to __cxxframehandler3 panic=\"abort\" didn't useful nm xxx.lib U __CxxFrameHandler3 U __CxxFrameHandler3 U __CxxFrameHandler3 | labels: A-linkage, O-windows, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62798", "text": "Disable llvm orcjit | labels: A-LLVM, C-enhancement, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62802", "text": "`miri` no longer builds after rust-lang/rust#62679 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62679, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Xanewok, do you think you would have tim | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62803", "text": "`rls` no longer builds after rust-lang/rust#62679 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62679, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @Xanewok, do you think you would have time | labels: P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_62807", "text": "Test `run-pass/generator/size-moved-locals.rs` fails on WASM | Due to a regression in `compiletest` some `run-pass` tests weren't run properly for some time and this is one of the regressions that slipped through during that time. https://github.com/rust-lang/rust/pull/62797#issuecomment-513279794 ``` 2019-07-19T15:47:51.8482480Z ---- [run-p | labels: T-compiler, O-wasm, C-bug, A-coroutines", "label": "high", "label_id": 1} {"id": "rust_62811", "text": "LinuxTools builders fails to (mabye?) push at the end of PR builds | Discovered through https://github.com/rust-lang/rust/pull/62766 the end of a build failed with: ``` 2019-07-18T17:43:29.7626178Z Verifying status of book... 2019-07-18T17:43:29.7645772Z Verifying status of nomicon... 2019-07-18T17:43:29.7656763Z Verifying status of reference... 2 | labels: T-infra", "label": "medium", "label_id": 2} {"id": "rust_62818", "text": "Conflicting trait impls are allowed when not actually used | The following code [(playground)](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=717aed92e64fd7e046d8167654b12b73): ```rust trait MyOtherTrait {} trait MyTrait {} struct MyStruct { field: T } impl MyTrait for MyStruct where MyStruct: MyOtherT | labels: A-trait-system, T-lang, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62820", "text": "Test `run-pass/command-uid-gid.rs` fails on emscripten | Due to a regression in `compiletest` some `run-pass` tests weren't run properly for some time and this is one of the regressions that slipped through during that time. https://github.com/rust-lang/rust/pull/62797#issuecomment-513428569 ``` 2019-07-20T02:37:15.4921233Z ---- [run-p | labels: A-testsuite, C-bug", "label": "high", "label_id": 1} {"id": "rust_62825", "text": "re-land #62150 (Implement mem::{zeroed,uninitialized} in terms of MaybeUninit) | #62150 got reverted to give users some time to migrate; we should re-land it. **Original issue:** https://github.com/rust-lang/rust/pull/62150 has changed the behavior of `mem::uninitialized()` (and `zeroed()`), causing a few popular crates to be killed by `SIGILL`. A writeup can | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_62830", "text": "Rustdoc link with module@ does not link to the module | Starting with an ambiguous lib.rs: ```rust pub mod x {} pub fn x() {} /// [x] pub struct S; ``` rustdoc correctly reports the ambiguity and suggests the possible resolutions: ```console warning: `x` is both a module and a function --> src/lib.rs:4:6 | 4 | /// [x] | ^ ambiguous li | labels: T-rustdoc, C-bug, A-intra-doc-links", "label": "medium", "label_id": 2} {"id": "rust_62831", "text": "assume all sequences have (unique) spans for now | Steps to reproduce: - Extract the archive [delegate_impl.tar[1].gz](https://github.com/rust-lang/rust/files/3413804/delegate_impl.tar.1.gz) - Run `cargo build` - Run `cargo test` The following generated macro is a likely source of error: ```rust pub trait Foo { fn len(&self) -> u | labels: I-ICE, A-macros, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62833", "text": "Anchors in intra doc link | lib.rs: ```rust /// A! /// /// # Errors /// /// None? pub struct A; /// [x][A], [y][A#errors], [z] /// /// [z]: A#errors pub struct B; ``` The documentation of B is rendered by rustdoc as \\` x, \\[y\\]\\[A#errors\\], z \\`, in which the x link correctly | labels: T-rustdoc, C-bug, A-intra-doc-links", "label": "medium", "label_id": 2} {"id": "rust_62834", "text": "Allow generic parameters in intra doc link | ```rust pub struct Collection { __: T } /// [`Collection`], [`Collection`] pub struct S; ``` Currently this renders as \\` Collection, \\[`Collection`\\] \\`, where the first link is ok but the second link is not rendered. I think these should both point to s | labels: T-rustdoc, C-enhancement, E-mentor, E-medium, A-intra-doc-links", "label": "low", "label_id": 3} {"id": "rust_62836", "text": "Add a way to get the number of bits in a representation | A few `core` APIs return values related to a number of bits. For example, the various [`leading_zeros` methods](https://doc.rust-lang.org/std/primitive.usize.html#method.leading_zeros), [`trailing_zeros` methods](https://doc.rust-lang.org/std/primitive.usize.html#method.trailing_ | labels: T-libs-api, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_62838", "text": "ICE on recursive struct | repro code: https://gist.github.com/sgrif/959bb5f820a0c9a616f569ea2195ff7c `Expression` on line 68 should be `Box`, introducing the indirection fixes the ICE. I haven't attempted to reduce beyond this example. `rustc 1.36.0 (a53f9df32 2019-07-03)` | labels: I-ICE, P-medium, T-compiler, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_62839", "text": "DWARF variant metadata for compressed enums with niche is ambiguous | After the change of DWARF metadata generation for enums (https://github.com/rust-lang/rust/pull/54004), compressed enums with niches are not distinguishable from tagged or empty enums in GDB pretty printing (not in the actual Rust pretty printers, as they do not support the new f | labels: A-debuginfo, T-compiler, C-bug, A-layout", "label": "question", "label_id": 4} {"id": "rust_62841", "text": "ARMv6 architecture support broken in nightly-2019-07-18 | The support for ARMv6 architecture was broken somewhere between 07e0c3651...bc2e84ca0: `nightly-2019-07-16` compiles file while `nightly-2019-07-17` produces binary that crashes with `Illegal instruction`. More specifically, this is a binary cross-compiled from `x86_64-unknown-li | labels: I-crash, A-LLVM, O-Arm, regression-from-stable-to-nightly, P-high, T-compiler", "label": "question", "label_id": 4} {"id": "rust_62843", "text": "Confusing error message when trying to use String as a Pattern | Consider this code ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=1a04d9b9f18985990294c60baf35155e)): ```rust fn main() { let line = String::from(\"abc\"); let pattern = String::from(\"bc\"); println!(\"{:?}\", line.find(pattern)); } ``` On both | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62844", "text": "Test `run-pass\\backtrace-debuginfo.rs` fails on i686-pc-windows-msvc | Due to a regression in `compiletest` some `run-pass` tests weren't run properly for some time and this is one of the regressions that slipped through during that time. https://github.com/rust-lang/rust/pull/62797#issuecomment-513516054 ``` ---- [run-pass] run-pass\\backtrace-debug | labels: A-testsuite, A-debuginfo, T-compiler, O-windows-msvc, C-bug", "label": "high", "label_id": 1} {"id": "rust_62846", "text": "tidy complains about valid stability attribute | With the following stability attribute ```rust #[unstable( feature = \"internal_uninit_const\", issue = \"0\", reason = \"hack to work around promotability\", )] ``` tidy complained ``` tidy error: /checkout/src/libcore/mem/maybe_uninit.rs:256: malformed stability attribute: missing `f | labels: A-testsuite, A-stability, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62847", "text": "test attribute doesn't check if another test attribute is specified | Currently if you slap `#[test]` two times you're going to get double tests in `cargo test` output. I suspect it doesn't really care about presence of other attributes. And I only noticed it because `tokio::test` attribute that wraps async functions for tests also appends own `#[t | labels: A-libtest, C-bug, T-libs", "label": "medium", "label_id": 2} {"id": "rust_62857", "text": "Update Condvar docs to use match ergonomics | In `std::sync::Condvar`'s [docs](https://doc.rust-lang.org/std/sync/struct.Condvar.html), it looks like [line 39](https://github.com/rust-lang/rust/blob/0c7cf8c633b388d0d8cc4991d41a281d6ddd47bd/src/libstd/sync/condvar.rs#L39): ```rust let &(ref lock, ref cvar) = &*pair2; ``` and | labels: E-easy, C-enhancement, T-libs-api, A-docs", "label": "low", "label_id": 3} {"id": "rust_62863", "text": "compiler nontermination after \"error: bare CR not allowed in doc-comment\" | ``` $ rustc -vV rustc 1.38.0-nightly (273f42b59 2019-07-21) binary: rustc commit-hash: 273f42b5964c29dda2c5a349dd4655529767b07f commit-date: 2019-07-21 host: x86_64-unknown-linux-gnu release: 1.38.0-nightly LLVM version: 9.0 $ echo cyAgaS8vL2cNLyBydW4tcA0vLyBhIHNi | base64 --deco | labels: A-attributes, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62865", "text": "Translate `\\r\\n` -> `\\n` when reading files | Currently, we handle `\\r\\n` explicitly in the lexer. We should do this at the file read time instead. Motivation: 1. Line endings should not affect semantics of the language. For example, git on windows by default checkouts with `\\r\\n` line endings, and it would be bad if compili | labels: A-frontend, C-cleanup, T-compiler", "label": "question", "label_id": 4} {"id": "rust_62867", "text": "Remove padding when code spans/code link spans are adjacent | I used ```markdown [`Stream`](futures::stream::Stream)`>` ``` in [some crates documentation](https://docs.rs/async-compression/0.1.0-alpha.1/async_compression/) which renders as ![concated-code](https://user-imag | labels: T-rustdoc, C-feature-request, A-rustdoc-ui", "label": "low", "label_id": 3} {"id": "rust_62868", "text": "Alternatives to rustc_plugin::registry for (Servo’s) custom lints? | Continuing from https://github.com/rust-lang/rust/pull/62727#issuecomment-513508389: > > Servo’s memory safety unfortunately still depends on a custom lint that checks that GC pointers on the stack are properly rooted: https://github.com/servo/servo/tree/cef98d2e5179/components/s | labels: A-lints, A-plugins, T-lang, T-compiler, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_62872", "text": "Unexpected type for async closure? | ``` alexgaynor@penguin /t/x> rustc --version rustc 1.38.0-nightly (273f42b59 2019-07-21) ``` ```rust #![feature(async_await, async_closure)] use futures::stream::StreamExt; pub async fn f + std::marker::Unpin>(data: &mut [Fut]) { data.iter_mu", "label": "medium", "label_id": 2} {"id": "rust_62875", "text": "Const generics and transmute: cannot transmute between types of different sizes | The following code should compile, but it doesn't: ``` #![feature(const_generics)] use std::{ mem::{self, MaybeUninit}, ptr, }; fn main() { } pub struct Foo { messages: [Option; SIZE], } impl Default for Foo<{SIZE}> { fn default() -> | labels: T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "medium", "label_id": 2} {"id": "rust_62876", "text": "Missing x86/x86_64 intrinsic: `_mm_loadu_si32` | [intel guide](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#techs=SSE2&text=_mm_loadu_si32) [rust docs show it as not there](https://doc.rust-lang.org/std/index.html?search=_mm_loadu_si32) | labels: O-x86_64, A-SIMD, O-x86_32", "label": "low", "label_id": 3} {"id": "rust_62878", "text": "Const generics: Wrong number of const arguments | The following should type check but does not: ```rust #![feature(const_generics)] fn foo() {} fn bar() { foo::<_, {[1]}>(); } ``` Errors with: ``` error[E0107]: wrong number of const arguments: expected 2, found 1 --> src/lib.rs:6:5 | 6 | foo::<_ | labels: T-compiler, C-bug, A-const-generics, A-lazy-normalization, requires-nightly, F-const_generics", "label": "medium", "label_id": 2} {"id": "rust_62879", "text": "ICE with const generics with dependent const parameters | ```rust #![feature(const_generics)] fn foo() {} fn bar() { foo::<1, {[1]}>(); } ``` results in an ICE: ``` error: internal compiler error: src/librustc/ty/subst.rs:597: const parameter `N/#0` (Const { ty: usize, val: Param(N/#0) }/0) out of range | labels: I-ICE, T-compiler, C-bug, A-const-generics, A-lazy-normalization, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_62881", "text": "ICE on \"index out of bounds: the len is 0 but the index is 1\" | When I try to run `rustc` on this program (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)) ```rust fn f() -> isize { fn f() -> isize {} pub f< ``` it crashes with this error: ``` error: this file contains an un-closed delimiter --> main.rs:1:45 | 1 | fn f() -> isiz | labels: I-ICE, A-parser, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62884", "text": "Slow recompilation of rustc with incremental compilation | I'm probably doing something wrong. The docs say that with incremental compilation you should be able to recompile rustc in about 30 seconds. For me it takes around 10 minutes. I've done the following ([as described in the docs](https://rust-lang.github.io/rustc-guide/how-to-buil | labels: C-enhancement, I-compiletime, T-compiler, A-incr-comp", "label": "low", "label_id": 3} {"id": "rust_62888", "text": "Link error if panic_handler is marked #[inline] | Test case: ```rust #![feature(core_intrinsics)] #![no_std] #![no_main] #[panic_handler] #[inline(always)] pub fn panic_imp(_: &core::panic::PanicInfo) -> ! { unsafe { core::intrinsics::abort(); } } #[no_mangle] pub extern fn main() -> i32 { panic!() } ``` Compiling with: ``` rust | labels: A-linkage, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62894", "text": "\"Aborted (core dumped)\" with asm! after \"error: expected expression, found ``\" | rustc crashes ungracefully when given the following input (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust asm!(f(assert_eq!(f/ ``` ``` $ rustc -vV rustc 1.38.0-nightly (273f42b59 2019-07-21) binary: rustc commit-hash: 273f42b5964c29dda2c5a349dd4655529767b | labels: E-easy, A-parser, E-needs-test, A-macros, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62895", "text": "ICE on \"index out of bounds: the len is 3 but the index is 4\" | I'm getting an internal compiler error on the following program (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust // run-pass fn v() -> isize { mod _{ pub fn g() -> isizee { mod _{ pub g() -> is (), w20); } (), w20); } ``` ``` $ RUST_BACKTRACE=1 rustc main. | labels: I-ICE, P-high, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62896", "text": "Segfault compiling libc on armv7-unknown-linux-gnueabihf | Originally reported as rust-lang/libc#1441 but I was asked to report this here. # Steps to reproduce ```sh cargo new --bin compile-fail cd compile-fail rustup override set nightly echo 'libc = \"=0.2.60\"' >> Cargo.toml cargo check --release ``` Output: ``` Created binary (applicat | labels: I-crash, A-LLVM, O-Arm, P-high, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_62899", "text": "Explicit `Self: Sized` bounds missing from generated documentation. | Nearly every method of `Iterator` has an explicit `Self: Sized` bound. These bounds are **present in libcore**'s documentation (e.g., [`Iterator::count`](https://doc.rust-lang.org/1.36.0/core/iter/trait.Iterator.html#method.count)), but are **missing in libstd**'s documentation ( | labels: T-rustdoc, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62913", "text": "ICE on \"lexer accepted unterminated literal with trailing slash\" | I'm getting an internal compiler on the following input (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust \"\\u\\\\\" ``` ``` error: incorrect unicode escape sequence --> main.rs:1:2 | 1 | \"\\u\\\\\" | ^^^ incorrect unicode escape sequence | = help: format of unicod | labels: I-ICE, A-parser, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_62915", "text": "arbitrary_enum_discriminant: needs raw ptr -> usize cast + \"a raw memory access tried to access part of a pointer value as raw bytes\" | With: ```rust #![feature(arbitrary_enum_discriminant)] #[repr(u8)] enum Beta { V1 = 41, V2() = Self::V2 as u8 + 1, } ``` something seemingly strange is going on: ``` error[E0658]: casting pointers to integers in constants is unstable --> src/lib.rs:6:12 | 6 | V2() = Self::V2 as u | labels: T-compiler, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_62918", "text": "Remove TLS dependency from async/await | Futures currently have a dependency on TLS for storing a pointer to` Context<'_>`. https://github.com/rust-lang/rust/blob/master/src/libstd/future.rs#L116 This makes usage in `no_std` environments quite difficult. | labels: C-enhancement, T-libs-api, A-async-await, AsyncAwait-Triaged", "label": "low", "label_id": 3} {"id": "rust_62919", "text": "`miri` no longer builds after rust-lang/rust#62902 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62902, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Mark-Simulacrum, do you think you would | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62922", "text": "Rework method disambiguation error to use structured suggestions | _Taken from https://github.com/rust-lang/rust/pull/62921#discussion_r306584349_ #62921 will extend the amount of times we display the disambiguated syntax in cases where multiple traits with the method being called is displayed in the following way: ``` error[E0034]: multiple app | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics, D-papercut", "label": "question", "label_id": 4} {"id": "rust_62924", "text": "Tracking issue for map_first_last: first/last methods on BTreeSet and BTreeMap | src/librustc_codegen_ssa/mir/analyze.rs:228:9 | 218 | fn visit_place(&mut self, | --------- `self` is declared here, outside of the functi | labels: C-enhancement, A-diagnostics, A-borrow-checker, T-compiler", "label": "low", "label_id": 3} {"id": "rust_62965", "text": "Initializing struct fields with `MaybeUninit` | The `MaybeUninit` docs have one weird, concerning section: > [There is currently no supported way to create a raw pointer or reference to a field of a struct inside `MaybeUninit`. That means it is not possible to create a struct by calling `MaybeUninit::uninit::() | labels: T-lang, C-feature-request, F-raw_ref_op", "label": "question", "label_id": 4} {"id": "rust_62967", "text": "Spurious failures when downloading awscli from PyPI | We recently started seeing multiple network failures while downloading awscli from PyPI: * https://github.com/rust-lang/rust/pull/62960: [log 1](https://dev.azure.com/rust-lang/e71b0ddf-dd27-435a-873c-e30f86eea377/_apis/build/builds/4208/logs/707), [log 2](https://dev.azure.com/r | labels: A-spurious, T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_62968", "text": "Rustdoc doesn't explain (or can't) linking to slice methods | Rustdoc documentation tells you link to an item with `[text](rust::path::to::item)`. You can even use paths appropriate to the current context to name an item, and so because `i32` and other primitives are always in scope you can point a link at `i32::abs` or whatever. However, y | labels: T-rustdoc, C-bug, A-intra-doc-links", "label": "low", "label_id": 3} {"id": "rust_62972", "text": "No way to extract flags arguments from unix::OpenOptionsExt | At the moment, if I want to write an interface that uses `OpenOptions`, but doesn't use the `OpenOptions::open` interface it's simply not possible to implement. The short reason why this is needed is because I am [writing a library](https://github.com/openSUSE/libpathrs) that use | labels: T-libs-api, C-feature-request", "label": "critical_bug", "label_id": 0} {"id": "rust_62973", "text": "ICE on \"byte index 1 is out of bounds of ``\" | I'm seeing an internal compiler error on the following input (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust fn p() { match s { v, E { [) {) } ``` (EDIT: the trailing newlines are important) ``` error: this file contains an un-closed delimiter --> main.rs | labels: I-ICE, A-parser", "label": "high", "label_id": 1} {"id": "rust_62976", "text": "Make references to GitHub issues in diagnostics consistent | Some diagnostics include a link to GitHub issues. From the ui testsuite, I found at least these two patterns: ``` = note: for more information, see https://github.com/rust-lang/rust/issues/51999 ``` ``` = note: for more information, see issue #36887 Self::AssocType; } impl MyTrait for () { existential type AssocType: Send; fn ret(&self) -> Self::AssocType { () } } impl<'a> MyTrait for &'a () { existential type AssocType: Send; fn ret | labels: T-compiler, A-impl-trait, C-bug, F-type_alias_impl_trait, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_62993", "text": "Boolean optimization no longer works | I'm unsure if this is a bug or not. The following code used to perform just as well as if there were no `let` statements. However, sometime since last year, that has changed. ```rust pub fn is_leap_year1(year: i32) -> bool { let div_4 = year % 4 == 0; let div_100 = year % 100 == | labels: A-LLVM, I-slow, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_62998", "text": "`miri` no longer builds after rust-lang/rust#62990 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62990, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have ti | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_62999", "text": "rustc should \"ellipsis\" very long lines when printing warnings | STR on macOS: - Clone https://github.com/RustAudio/coreaudio-sys - Checkout commit 13a32d718647b9e5be1defdef8197958cfda31fa - Edit Cargo.toml to update the bindgen dependency from 0.42 to 0.49. - `cargo build` - Admire the 200MB of warnings scrolling in your terminal for ~800 act | labels: A-diagnostics, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63003", "text": "Lifetime elision rules in `self` types | This issue tracking lifetime elision rules in `self` types. Here are test cases of elision rules introduced in #61207: https://github.com/rust-lang/rust/blob/d79d13f9e6ca05f2002446addfbd68e63e419cc1/src/test/ui/self/elision/README.md This rule has already been applied in Rust 1.3 | labels: A-lifetimes, I-needs-decision, T-lang, A-inference, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_63005", "text": "rustdoc: Searching for path (including a `::`) does not work | Say I want to find the docs for `Vec::new`, so I search for that. What I get is [this](https://doc.rust-lang.org/nightly/std/?search=Vec%3A%3Anew): almost all of these results are entirely irrelevant. rustdoc search should understand enough about Rust syntax to handle `::` approp | labels: T-rustdoc, C-bug", "label": "low", "label_id": 3} {"id": "rust_63016", "text": "rustdoc silently fails parsing some doctests when using a playground URL | For example running `rustdoc --markdown-playground-url=https://play.rust-lang.org/ foo.md` on: ``````markdown # test ``` # #![feature(async_await)] use std::future::Future; use std::pin::Pin; fn foo_recursive(n: usize) -> Pin>> { Box::pin(async move { | labels: T-rustdoc, I-ICE, C-bug", "label": "high", "label_id": 1} {"id": "rust_63019", "text": "Missing documentation folder in armv7-unknown-linux-gnueabihf installer (both standalone and using rustup) | Tried in Linux raspberrypi 4.4.9-v7 Friday, May 6 2016, armv7l GNU/Linux. All the steps described below were executed in 23th or July, 2019. While following the installation guide (ref001, at the bottom of this report), and once Rust is sucessfully installed in the system (stable | labels: O-Arm, A-docs, T-infra", "label": "low", "label_id": 3} {"id": "rust_63020", "text": "rustc_args_required_const on parameter not treated as constant in argument | This implementation of wasm32's v8x16.shuffle intrinsic does not build (add to stdarch/crates/core_arch/src/wasm32/simd128.rs): ``` #[inline] #[cfg(not(only_node_compatible_functions))] #[cfg_attr(test, assert_instr(\"v8x16.shuffle\"))] #[rustc_args_required_const(2)] pub fn v8x16_ | labels: T-compiler, A-SIMD, C-bug, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_63021", "text": "Strange Arc::ptr_eq behaviour (duplicate vtables?) | Hello. This issue is simmilar to https://github.com/rust-lang/rust/issues/48795 and https://github.com/rust-lang/rust/issues/46139 but have more strange behaviour and suggestion. The problem is located when we clone `Arc` to `Arc` in one function, return `Arc` and then clo | labels: C-enhancement, T-lang", "label": "low", "label_id": 3} {"id": "rust_63023", "text": "On i686 release builds, Valgrind reports depending on uninitialized values | For the following *main.rs* ```rust fn main() { let x = &[0i32]; let _ = (x.iter().map(|_| 1i32)) .chain(x.iter().map(|_| 1i32)) .chain(x.iter().map(|_| 1i32)) .chain(x.iter().map(|_| 1i32)) .chain(x.iter().map(|_| 1i32)) .collect::>(); } ``` On i686 GNU/Linux, for a rel | labels: O-x86_32", "label": "medium", "label_id": 2} {"id": "rust_63024", "text": "`miri` no longer builds after rust-lang/rust#63015 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63015, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have tim | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63026", "text": "ICE: local variable without a name | The following code causes an internal compiler error on 1.37.0-beta.6 and 1.38.0-nightly. On stable it's a simple error, though the message could be improved (#63027). ```rust use std::collections::HashMap; use std::hash::Hash; fn group_by(xs: &mut I, f: F) -> HashMap(xs: &mut I, f: F) -> HashMap> where I: Iterator, F: Fn(&I::It | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63031", "text": "ICE typechecking closure object with bound lifetime | I don't think this was previously submitted as an issue, though it was mentioned on the [Rust Internals forum](https://users.rust-lang.org/t/generic-closure-arguments-and-hrtbs/13185/5). ```rust trait Lf<'a> { type Type; } struct F32; impl<'a> Lf<'a> for F32 { type Type = f32; } | labels: A-codegen, I-ICE, P-medium, A-closures, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63032", "text": "Lifetime is unnecessarily captured in nested functions returning impl trait via async | When trying to create some futures that do a bit of work up-front to avoid borrowing some inputs, I ran into this strange issue where it seems like an input lifetime is being unnecessarily captured by the returned impl trait even though the value isn't: ```rust #![feature(async_a | labels: T-compiler, A-impl-trait, A-async-await, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_63033", "text": "Async fn does not compile if lifetime does not appear in bounds (sometimes) | ```rust #![feature(async_await)] use std::marker::PhantomData; trait Trait {} async fn f<'a>(reference: &(), marker: PhantomData) {} ``` This fails with: ```console error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> src/main | labels: A-lifetimes, T-compiler, C-bug, A-async-await, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_63037", "text": "rustdoc shows anonymous elided lifetimes in async fn signature | When run on an `async fn` with elided lifetimes, `rustdoc` generates documentation containing the anonymous elided lifetimes in the function's signature. Running `rustdoc` on the blocking variant of the same function produces a correct signature. You can reproduce this issue by g | labels: T-rustdoc, A-lifetimes, C-bug", "label": "low", "label_id": 3} {"id": "rust_63039", "text": "Builtin macro pattern separator | Since #62243 builtin macros use `,` as a separator between different patterns. Although, all other macros use `;` instead. Is it intended change? This change breaks parser in IntelliJ Rust plugin. Should we adjust our parser or it should be fixed from stdlib side?", "label": "medium", "label_id": 2} {"id": "rust_63040", "text": "Invalid suggestion when returning struct with lifetime param missing | ```rust struct Context<'a> { a: &'a (), } fn context() -> Context { loop {} } ``` ([Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8e98596fa4a1d144fa7c8061697cbcb1)) Errors: ``` Compiling playground v0.0.1 (/playground) error[E0106]: missing l | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2} {"id": "rust_63042", "text": "[docs] auto impl trait should be sorted | That'd make tests more accurate. | labels: T-rustdoc, C-enhancement", "label": "low", "label_id": 3} {"id": "rust_63046", "text": "\"Variable is assigned to, but never used\" with += operator | Tested on both rust 1.36 and 1.38 (nightly): $ rustc -V rustc 1.36.0 (a53f9df32 2019-07-03) $ rustc +nightly -V rustc 1.38.0-nightly (c43753f91 2019-07-26) The following code: ``` $ cat src/main.rs fn main() { let mut error = 0; for i in 0..3 { error += i; } } ``` Produces the fo", "label": "medium", "label_id": 2} {"id": "rust_63047", "text": "-Zprofile and -Clink-dead-code enabled leads to the linking error on macOS | I'm integrating [grcov](https://github.com/mozilla/grcov) and have macOS build failures with a linkage error while both `-Zprofile` and `-Clink-dead-code` flags enabled. Consider a cargo project with the following manifest: ```toml [package] name = \"foo\" version = \"0.1.0\" authors | labels: A-linkage, O-macos, C-bug, A-code-coverage", "label": "medium", "label_id": 2} {"id": "rust_63058", "text": "Simple software design pattern not possible | ``` struct Item { name: String } struct Human { items: Vec, name: String } impl Human { fn rename(&self, i: &mut Item) { i.name = self.name.clone(); } fn work(&mut self) { for i in &mut self.items { self.rename(i); } } } fn main() { let mut human = Human{items: Vec::new(), ", "label": "medium", "label_id": 2} {"id": "rust_63060", "text": "ANSI mode text breakage on Windows PowerShell | 1.) In the \"Type here to search\" box search \"Registry Editor\" and open the Registry Editor app (If it asks if you want to allow the app to make changes to your device choose \"Yes\"). 2.) Click the drop down arrow for \"HKEY_CURRENT_USER\" and select the folder named \"Console\". 3.) I", "label": "medium", "label_id": 2} {"id": "rust_63064", "text": "dead_code lint highlights too much on functions with multi-line signatures | With the following example code: ```rust fn unused() { println!(\"blah\"); } fn unused2(var: i32) { println!(\"foo {}\", var); } fn unused3( var: i32, ) { println!(\"bar {}\", var); } fn main() { println!(\"Hello world!\"); } ``` ([Playground](https://play.rust-lang.org/?version=nightly& | labels: A-lints, A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63078", "text": "E0277 should put emphasis on containing function's return type | I got the following error today: ``` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`) --> src/main.rs:29:20 | 29 | let mut resp = reqwest::get(\"...\")?; | ^^^^^^^^^^^^^^^^^^^^ cannot u | labels: E-easy, C-enhancement, A-diagnostics, T-compiler, F-on_unimplemented", "label": "low", "label_id": 3} {"id": "rust_63082", "text": "Confusing error message when matching on an unnecessarily-unwrapped value | Consider this code ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c083e7005433f0e7b29d10d8f2fe4725)): ```rust pub fn test(input: &str) -> Result { match serde_json::from_str(input).unwrap() { Ok(v) => Ok(v), Err(w | labels: C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63085", "text": "Reevaluate Miri engine alignment checks | Two PRs will likely land soon that change the way the Miri engine does alignment checks: https://github.com/rust-lang/rust/pull/63079 and https://github.com/rust-lang/rust/pull/63075. The former entirely disables alignment checks for CTFE (when the Miri engine is used as part of | labels: T-compiler, A-const-eval, A-miri", "label": "question", "label_id": 4} {"id": "rust_63091", "text": "Invalid span when emitting a diagnostic note on the top-level module | While I was investigating a fix for #63064, I noticed one problematic error case, where, as it turns out, the compiler emits a broken span. ```rust fn main() {} trait Foo> {} ``` This is the error I'm getting with the nightly: ``` error[E0391]: cycle detected whe | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63097", "text": "`type S = Option>;` should compile | It seems a compiler bug to me. I tried this code: ```rust type S = Option>; ``` I expected it could compile, but instead: ```bash lihz:linkedlist lihzhang$ cargo build Compiling linkedlist v0.1.0 (/Users/lihzhang/Documents/com.github/linkedlist) error[E0391]: cycle detecte | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_63098", "text": "`f64::round` produces Illegal Instruction on `arm-unknown-linux-gnueabihf` | I am cross-compiling for a Raspberry Pi Zero W (`arm-unknown-linux-gnueabihf`), and I am experiencing a strange issue when using `f64::round`, which leads to an β€œIllegal Instruction”. Here are some minimal examples: 1. Illegal Instruction at line 4 ```rust fn main() { let v: f64 ", "label": "medium", "label_id": 2} {"id": "rust_63100", "text": "\"Try invoking the function\" hint | Hi, Let's consider following code: ```rust fn foo() -> usize { 0 } fn bar(i: usize) { } fn main() { bar(foo); } ``` Right now it fails with the `expected usize, found fn item` message - I think it would be helpful if compiler bragged about missing parentheses when function's retu | labels: A-diagnostics, T-compiler, A-async-await, A-suggestion-diagnostics, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_63101", "text": "Support armv7-unknown-linux-gnueabi and armv7-unknown-linux-musleabi (soft-float variants) | Currently for armv7 only the hardfloat variants (`armv7-unknown-linux-gnueabihf` and `armv7-unknown-linux-musleabihf`) are supported. I'll try to open a pull request as this seems to be a small change. | labels: O-linux, O-Arm, T-compiler, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_63102", "text": "decl macro 2.0 doesn't allow trailing comma | ```rust macro abc { () => {}, ``` ([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6986bf981691d75da249f136a16e2e07)) Errors: ``` Compiling playground v0.0.1 (/playground) error: unexpected end of macro invocation --> src/lib.rs:2:14 | 2 | () | labels: A-parser, T-compiler, A-decl-macros-2-0, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63104", "text": "Should PartialOrd provide impl for Ord to avoid boilerplate? | Currently `std` gives the following example in \"[How can I implement `Ord`?](https://doc.rust-lang.org/std/cmp/trait.Ord.html#how-can-i-implement-ord)\": ```rust use std::cmp::Ordering; #[derive(Eq)] struct Person { id: u32, name: String, height: u32, } impl Ord for Person { fn cm | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_63110", "text": "Redundant E0106 missing lifetime error and rust_2018_idioms missing lifetime lint | While hacking in the compiler I got the following error: ``` error: hidden lifetime parameters in types are deprecated --> src/libsyntax_ext/format.rs:113:43 | 113 | arg_with_formatting_spans: Vec<(Span, parse::FormatSpec)>, | ^^^^^^^^^^^^^^^^^- help: indicate the anonymous lifet | labels: C-enhancement, A-lints, A-diagnostics, T-compiler, A-suggestion-diagnostics, L-elided_lifetimes_in_paths", "label": "low", "label_id": 3} {"id": "rust_63113", "text": "Improve recovery diagnostic for `for ( $pat in $expr ) $block` | Roughly according to https://github.com/rust-lang/rust/pull/62928#discussion_r308365465. cc @estebank | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics, D-papercut", "label": "question", "label_id": 4} {"id": "rust_63115", "text": "\"`X...` range patterns are not supported\" occurring in today's nightly | The CI for `libssh2-sys` started to fail today with this error: ``` error: `X...` range patterns are not supported --> C:\\Users\\wez\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\extprim-1.7.0\\src\\traits.rs:94:21 | 94 | 1 ... $e => u128::new(mantissa) << exp, | ^^^^^ help: try u | labels: A-parser, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_63116", "text": "ICE on \"internal error: entered unreachable code\" | I'm seeing an internal compiler error on the following input (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust impl W main.rs:1:18 | 1 | impl W | We could improve the [`std::thread::Builder::name()`](https://doc.rust-lang.org/std/thread/struct.Builder.html#method.name) method by accepting not only a ``, but anything that could be converted to a string: ```rust pub fn name>(self, name: S) -> Builder; | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_63133", "text": "RGB_GAMA | #C0C0C0_ C+M+Y author_email=\"ritiekmalhotra123@gmail.com", "label": "medium", "label_id": 2} {"id": "rust_63135", "text": "ICE on \"Error constructed but not emitted\" | I'm seeing an internal compiler error on the following input (found by [fuzz-rustc](https://github.com/dwrensha/fuzz-rustc)): ```rust fn i(n{...,f # ``` ``` error: this file contains an un-closed delimiter --> main.rs:2:2 | 1 | fn i(n{...,f # | - - un-closed delimiter | | | un-cl | labels: I-ICE, A-parser, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63136", "text": "\"match arms have incompatible types\" hint incorrect | > this and all prior arms are found to be of type `!` Only some of the prior arms are of type `!`, the rest is of type `FloatCC`. ``` error[E0308]: match arms have incompatible types --> src/llvm_intrinsics.rs:77:33 | 60 | / match scalar.assert_bits(Size::from_bytes(1)) { 61 | | | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63138", "text": "Rustdoc search results truncated | https://docs.rs/cranelift-codegen/0.37.0/cranelift_codegen/ir/trait.InstBuilder.html?search=I32X ![image](https://user-images.githubusercontent.com/17426603/62130746-f768d200-b2d9-11e9-89d9-b9201ff5dda2.png) Reason: `max-height: calc(100vh - 32px);` on parent `
f64` - `div_duration_f32(self, rhs: Duration) -> f32` | labels: T-libs-api, B-unstable, C-tracking-issue, requires-nightly, Libs-Tracked, Libs-Small", "label": "medium", "label_id": 2} {"id": "rust_63140", "text": "Generic type parameters used in expression? | Is there a way to use a generic type parameter in an expression? For example: ~~~rust fn SomeGenericFunc() { if T : Display { // Here we know T implements Display println!(\"{}\", T); } else if T : Debug { // Here we know T implements Debug println!(\"{:?}\", T); } else { println!", "label": "medium", "label_id": 2} {"id": "rust_63142", "text": "Using proc macros through a re-exported crate raises rustc_private unstability error | When a library A depends on a library B, which re-exports a library C that (re-?)exports procedural macros, using them in A through the re-export in B may result in an E0658 error. I tried this code: ```rust // src/lib.rs use inner::serde::Deserialize; #[derive(Deserialize)] pub | labels: C-enhancement, A-diagnostics, A-resolve, A-macros, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63143", "text": "Box \"doesn't have a size known at compile-time\" wrong diagnostic | If I do ... ```rust fn main() { let x = \"hello\"; let y = Box::new(*x); } ``` I get the following error ... ``` --> src/main.rs:3:13 | 3 | let y = Box::new(*x); | ^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `st | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63145", "text": "Fix to #62194 broke the coherence tests and made error messages more mysterious | PR #62696 had *removed* the notes from the tests for the upstream/downstream printing logic, so now that logic is not tested: https://github.com/rust-lang/rust/commit/2ced474e808d59e4b3bf2c6874e40446a4598f51 Plus, the new error messages are worse: an upstream impl can indeed be a | labels: A-diagnostics, A-trait-system, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63150", "text": "incremental compilation DepNode Bug running cargo check | # cargo check panic # code that produced the panic ```rust type Data = Vec; #[derive(Debug)] enum EventImpl{ NoteOn(u8), NoteOff(u8) } #[derive(Debug)] struct Event{ data:Data, i:EventImpl } impl Event{ fn new(data:Data)->Self{ Event{ i: match data[0]{ 0 => EventImpl::NoteOn( | labels: I-ICE, P-high, T-compiler, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63151", "text": "Spurious unused field warning when matching variants under a `Self` scope | This code should compile without warnings: ```rust enum Enum { Variant { field: usize } } impl Enum { fn read_field(self) -> usize { match self { // Enum::Variant { field } => field Self::Variant { field } => field } } } fn main() { let e = Enum::Variant { field: 42 }; println!(\" | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63154", "text": "Associated types, impl traits ~and closures~; oh my, an ICE. | While experimenting with some code I hit this ICE. Interestingly, when running `cargo test` a second time, it magically works - skipping the error. Also, `cargo miri test` works fine too. I'm on a slightly older nightly because some rustup components are missing on the latest. ht | labels: I-ICE, A-closures, A-associated-items, P-high, T-compiler, A-MIR", "label": "high", "label_id": 1} {"id": "rust_63156", "text": "lint of unnecessary parentheses around `if` condition may case error | when unnecessary parentheses is removed, may lack a whitespace between `if` and `expr`. example `if(is_prime) {println!(\"hello\")};` while be replaced to `ifis_prime {println!(\"hello\")};` Maybe we should replare `(expr)` with a pair of whitespace around `expr`, instead of just `ex | labels: E-easy, A-lints, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_63157", "text": "Drop ordering breaks macro hygiene | Macro hygiene implies any objects created in the macro should be dropped before any code run after it executes. This does not happen in latest stable or nightly. I tried this code: ```rust use std::io::Write; macro_rules! out { ($content:expr $(, $vars:expr)*) => { let stdout = s | labels: A-destructors, A-macros, T-lang", "label": "medium", "label_id": 2} {"id": "rust_63159", "text": "Do copy[_nonoverlapping]/swap[_nonoverlapping] do typed copies? | The following example ([godbolt](https://rust.godbolt.org/z/SDb-pj)): ```rust #[repr(align(128))] #[derive(Copy, Clone)] pub struct A(u8); pub unsafe fn foo(x: &A) -> A { *x } pub unsafe fn bar(x: &A) -> A { let mut y: A = std::mem::uninitialized(); std::ptr::copy_nonoverlapping( | labels: A-LLVM, I-slow, C-enhancement, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63160", "text": "Redox builder is temporarily disabled | #61393 temporarily disables the redox builder, this issue tracks re-enabling it. cc @jackpot51 | labels: T-infra, O-redox", "label": "medium", "label_id": 2} {"id": "rust_63161", "text": "ICE: index out of bounds: the len is 7 but the index is 7 | I encountered an ICE today. Below you find the backtrace of running `cargo test`. I ran `cargo clean` afterwards and the ICE vanished, so it seams to be connected to incremental compilation. ``` thread 'rustc' panicked at 'index out of bounds: the len is 7 but the index is 7', /r | labels: I-ICE, T-compiler, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63164", "text": "internal error: entered unreachable code | Seems to be something to do with Rocket. Having a `get` on the internal function is causing the compiler to blow up. ```rust fn moo() { #[get(\"/moo\")] fn get() -> String { \"moo\".to_string() } } ``` Version: ``` rustc 1.38.0-nightly (dddb7fca0 2019-07-30) binary: rustc commit-hash | labels: I-ICE, A-visibility, A-macros, P-high, T-compiler, A-decl-macros-2-0", "label": "high", "label_id": 1} {"id": "rust_63167", "text": "Confusing error message with type unification of impl Traits | It took a colleague explaining to me that the return type of a function returning an impl Trait is unique across function definitions for me to understand the following error: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4ceda076c82b01ea279e8864518ab5d9 | labels: C-enhancement, A-diagnostics, T-compiler, A-impl-trait, A-async-await, AsyncAwait-Triaged", "label": "low", "label_id": 3} {"id": "rust_63168", "text": "Tracking issue for Result::cloned, Result::cloned_err, Result::copied, Result::copied_err | [PR](https://github.com/rust-lang/rust/pull/63166) | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_63169", "text": "impl trait in type aliases does not trigger \"private type in public interface\" errors | The current implementation of `existential_type` does not trigger any \"private type in public interface\" errors, for the following code ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f8b7bf41e44a8f7ec207f35eaf879f16)): ```rust #![feature(ex | labels: A-resolve, A-visibility, I-needs-decision, T-lang, T-compiler, A-impl-trait", "label": "medium", "label_id": 2} {"id": "rust_63172", "text": "TcpListener does not listen any requests | I wrote this code for build a simple TCP server: ```rust use std::io::prelude::*; use std::net::{TcpListener, TcpStream}; fn main() { let server = TcpListener::bind(\"127.0.0.1:5600\").unwrap(); println!(\"Server is working.\"); for stream in server.incoming() { let stream = stream.u", "label": "medium", "label_id": 2} {"id": "rust_63183", "text": "fs::read_dir() and ReadDir need clear warnings about not relying on iteration order | The docs for `fs::read_dir()` and `fs::ReadDir` need to clearly state that iteration order is implementation defined and may vary not just between OS's but between identical versions of a directory on different filesystems. Currently the warning on `fs::read_dir()` is uselessly v | labels: E-easy, C-enhancement, E-mentor, A-docs", "label": "low", "label_id": 3} {"id": "rust_63190", "text": "Toolstate for Linux not correctly published | The toolstate for Linux at https://rust-lang-nursery.github.io/rust-toolstate/ claims that tools are still failing. E.g., https://github.com/rust-lang/rust/pull/63141 landed, but only the Windows toolstate was considered fixed after that. Looks like something is breaking publishi | labels: T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63195", "text": "`rls` no longer builds after rust-lang/rust#62507 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62507, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @petrochenkov, do you think you would have | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63204", "text": "Investigate whether `Ty` and `OpaqueTy` can be merged | A similar sentiment is probably valid in other contexts, but the original motivation for this is https://github.com/rust-lang/rust/pull/63180#discussion_r309927011. | labels: C-cleanup, T-compiler, A-impl-trait, F-type_alias_impl_trait, requires-nightly", "label": "question", "label_id": 4} {"id": "rust_63205", "text": "document some diagnostics for min TAIT in stabilization report | This issue was repurposed. It now refers to documenting the diagnostics for various errors and other cases in the [`min_type_alias_impl_trait` stabilization report](https://hackmd.io/o9KO-D8aSb6bJgQ1froVTA). -- @nikomatsakis ~~After https://github.com/rust-lang/rust/issues/63063 | labels: C-enhancement, A-diagnostics, T-compiler, A-impl-trait, F-type_alias_impl_trait, requires-nightly", "label": "low", "label_id": 3} {"id": "rust_63210", "text": "Formal parameter attributes won't be passed into proc-macro | As this [example repo](https://github.com/Hexilee/params-attribute-example/blob/master/proc-macro-tests/rename_params.rs) This is the example proc-macro: ```rust extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_attribute] pub fn rename_params(_args: TokenStream, | labels: A-attributes, A-macros, T-compiler, C-bug, requires-nightly, F-param_attrs", "label": "medium", "label_id": 2} {"id": "rust_63211", "text": "Associated types cause \"expected\" and \"found\" to be reversed in error messages | TL;DR: `Iterator` type mismatches are described wrong. In some cases -- I've reproduced consistently with associated types, but haven't explored further -- type mismatches are reported incorrectly, with the expected type being reported as \"found\" and the actual type bei | labels: A-type-system, A-diagnostics, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63219", "text": "`miri` no longer builds after rust-lang/rust#63214 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63214, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have tim | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63220", "text": "Move closure copies :Copy variables silently | ## The Good Given the following code: ```rust fn main() { let mut x = 0; dbg!(x); } ``` https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=19261742184207a4075885cae58680e1 I got a reasonable warning: ``` warning: variable does not need to be mutable --> src/m | labels: C-enhancement, A-lints, A-closures, T-lang", "label": "low", "label_id": 3} {"id": "rust_63222", "text": "[rustdoc] stabilize #[doc(alias = ...)] | cc @rust-lang/rustdoc | labels: T-rustdoc, A-doc-alias", "label": "medium", "label_id": 2} {"id": "rust_63223", "text": "Compiler panic on a macro invocation combined with invalid pub declaration | The compiler panics when compiling the following code. I had been expecting to see syntax errors instead. Deleting either line causes the compiler not to panic and give expected error messages. ```rust const FOO: &str = b!(\"foo\"); pub struct Bar { pub(in ::a) x: u64 } ``` ([Playg | labels: A-resolve, I-ICE, A-macros, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63224", "text": "How to parse rmeta file | Hello, I'm currently working on the compiler process of rust and I want to know some details about the metadata included in the rlib file. I have extracted the rmeta file from the rlib file, however, I found out it is also a binary file. I wonder if there are any approaches or to | labels: A-metadata, T-compiler, E-help-wanted", "label": "medium", "label_id": 2} {"id": "rust_63225", "text": "Error with nested async fn and anonymous lifetimes | The following breaks on nightly (see [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a1aabca3f0059c24f101e3a149632fbd)) ```rust #![feature(async_await)] struct Foo<'a>(&'a ()); impl Foo<'_> { fn test() { async fn test() {} } } ``` With: ``` e | labels: T-compiler, C-bug, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2} {"id": "rust_63226", "text": "ICE when constructing monomorphic vtable in a static in dependent crate. | This is ICE happens when I call `ROnce::new` from the abi_stable crate in const contexts in dependent crates/doctests, but not when using the `ROnce::NEW` associated constant. # Reproducing It can be reproduced using a doctest in the playground: https://play.rust-lang.org/?versio | labels: E-easy, A-codegen, I-ICE, E-mentor, P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_63231", "text": "Adding stuff to a particular existing crate? | Well simply put - monkey patching code. Oh boy, I can feel the raised eyebrows already. I am working on an embedded project. Worked on Cortex-M3 until now (thumbv7v-m), and recently switched to Cortex-M (thumbv6-m), and all hell broke lose. The main issue is that the instruction ", "label": "question", "label_id": 4} {"id": "rust_63237", "text": "Fix test style in unused parentheses lint test | Update test file to use `#![deny(unused_parens)]` + `//~ ERROR` annotations instead of `pretty-json` (see https://rust-lang.github.io/rustc-guide/tests/adding.html) The files need to update are: - `test/lint/unused_parens_json_suggestions.rs` - `test/lint/used_parens_remove_json_ | labels: E-easy, C-cleanup, A-testsuite, A-lints, E-mentor, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63238", "text": "deps.rs EXCEPTIONS needs to be re-triaged | The [EXCEPTIONS](https://github.com/rust-lang/rust/blob/d7270712cb446aad0817040bbca73a8d024f67b0/src/tools/tidy/src/deps.rs#L27) list lists license exceptions. After reviewing a few of them, they seem to be out of date, and some that were copyleft are now permissive, and some hav | labels: T-core", "label": "medium", "label_id": 2} {"id": "rust_63244", "text": "Nested tuple leads to worse code | For ```rust pub struct Moo((u128, ())); pub fn moo(a: Moo, b: Moo) -> Moo { Moo(((a.0).0 + (b.0).0, ())) } pub struct Baa(u128, ()); pub fn baa(a: Baa, b: Baa) -> Baa { Baa(a.0 + b.0, ()) } ``` `cargo asm` gives ```asm try::moo: mov rcx, qword, ptr, [rdx] add rcx, qword, ptr, [rs | labels: I-slow, A-codegen, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63249", "text": "rustc claims that \"array lengths can't depend on generic parameters\" for exactly one type of expression, while various other far more complex expressions involving const generics work perfectly | Quite simply: The fact that [this playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c567834235a3f1354b9a96fdbedfad35) gives an error (which is literally the only syntactic way I'm aware of to get that error), while on the other hand I was a | labels: T-compiler, A-const-generics, A-lazy-normalization", "label": "question", "label_id": 4} {"id": "rust_63255", "text": "\"can't qualify macro invocation with `pub`\" error can fire without any macro invocations | With #63180 in effect, code using `existential type` produces confusing error: ``` error: can't qualify macro invocation with `pub` --> src/mixer.rs:6:1 | 6 | pub existential type T: MotorCtrl; | ^^^ | = help: try adjusting the macro to put `pub` inside the invocation ``` The act | labels: A-diagnostics, A-parser, T-compiler, C-bug, D-incorrect", "label": "medium", "label_id": 2} {"id": "rust_63256", "text": "Segmentation fault when using spmc:::channel | After a few days studying Rust I have come to a road block with segmentation faults and other errors when running a simple program using an mpsc channel. use std::thread; use std::fs::File; use std::io::{BufReader,BufRead}; pub fn main() { let (tx, rx) = spmc::channel(); let mut | labels: I-crash, T-libs-api, I-unsound, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63258", "text": "Opt-level profile override causes function miscompile to ud2 on MacOS | Opt-level profile override causes function miscompile to ud2 on MacOS. I wasn't able to reproduce this bug on Windows 10. **rustc version:** 1.38.0-nightly (6e0d27d93 2019-08-03) The most minimal example I could come up with: https://github.com/mvlabat/ud2 **src/main.rs:** https: | labels: O-macos", "label": "medium", "label_id": 2} {"id": "rust_63263", "text": "ICE with closure return type as impl trait type alias defining use | In an attempt to make the compiler recognize my defining use of an impl trait type alias without making a separate wrapper function, I ran this code, but it resulted in an ICE: ```rust #![feature(type_alias_impl_trait)] pub type Closure = impl FnOnce(); fn main() { || -> Closure | labels: I-ICE, A-closures, T-compiler, A-impl-trait, C-bug, F-type_alias_impl_trait", "label": "high", "label_id": 1} {"id": "rust_63267", "text": "The standard library should have a basic future runtime | While libraries like Tokio and runtime exist, there's a real discovery problem for new users. And importing a large library like those can increase compile time a bunch and whatnot. For ease of use, I'm proposing that the standard library contains a simple future runtime. It does", "label": "medium", "label_id": 2} {"id": "rust_63268", "text": "rustdoc: Built-in macros are not documented in all the necessary locations | NOTE: Some cases below assume https://github.com/rust-lang/rust/pull/63056 has landed. - :negative_squared_cross_mark: https://doc.rust-lang.org/nightly/core/default/index.html doesn't contain the derive macro `Default`. :heavy_check_mark: Compare with the https://doc.rust-lang.o | labels: T-rustdoc, A-macros, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63271", "text": "f32/64::asinh() should return -0.0 for -0.0 | Currently, both of the following return false: ```rust (-0.0 as f64).asinh().is_sign_negative() (-0.0 as f32).asinh().is_sign_negative() ``` However, in other languages like [C](https://en.cppreference.com/w/c/numeric/math/asinh), `asinh(-0.0)` would always return `-0.0`. We migh | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63275", "text": "Should the Future trait be in the prelude? | I'm curious what opinions people have about this. | labels: T-lang, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_63276", "text": "rustdoc: `DerefMut` methods are missing from sidebar | Take a look at https://doc.rust-lang.org/std/vec/struct.Vec.html. The sidebar has `Deref`, but not `DerefMut`, so methods like `sort` are missing. | labels: T-rustdoc, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63277", "text": "Different error messages between async and regular functions | Hi, Let's consider following code: ```rust fn foo() -> Result { unimplemented!() } fn bar() -> Result<(), ()> { foo()?; () } ``` There's an error in the penultimate line - it should say `Ok(())` and Rust correctly helps to spot the mistake: ``` | 7 | fn bar() -> Result< | labels: A-diagnostics, T-compiler, A-async-await", "label": "medium", "label_id": 2} {"id": "rust_63278", "text": "How to do Zero-fill right shift in rust? | ```rust fn main(){ let i:i32 = -9; println!(\"{}\", i >>> 3) } ```", "label": "medium", "label_id": 2} {"id": "rust_63279", "text": "ICE: instantiated twice | While minimizing https://github.com/rust-lang/rust/issues/63263 I stumbled upon another ICE ```rust #![feature(type_alias_impl_trait)] type Closure = impl FnOnce(); fn c() -> Closure { || -> Closure { || () } } fn main() {} ``` ([Playground](https://play.rust-lang.org/?version=ni | labels: I-ICE, E-needs-test, A-closures, T-compiler, A-impl-trait, C-bug", "label": "high", "label_id": 1} {"id": "rust_63283", "text": "ICE - 'cannot access a scoped thread local variable without calling `set` first' | Hello, After updating nightly version to `2019-07-31` (also fails on `2019-08-04`), previously working code no longer compiles. I can confirm that it compiles successfully on `nightly-2019-07-30`. EDIT: Happens on `debug` aswell, also doesn't happen on macOS, but I'm not sure whe | labels: I-ICE, T-compiler, A-thread-locals, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63284", "text": "update rustdoc's syntax checker to work with error-recovering lexer | Rustdoc processes code inside of `` ``` `` blocks in two ways: * _First_, the code is [checked](https://github.com/rust-lang/rust/blob/4be067558962c004b638e4c6f162d50f7c0c98b6/src/librustdoc/passes/check_code_block_syntax.rs#L28-L99) for lexer errors * _Second_, lexer-based synta | labels: C-cleanup, T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_63288", "text": "Parser silent exit on invalid input | I'm using rustc's parser ([`parse_crate_mod`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/parse/parser/struct.Parser.html#method.parse_crate_mod) more specifically) as part of a program I'm writing and for some inputs, the parser terminates my program. Using the curren | labels: A-parser", "label": "medium", "label_id": 2} {"id": "rust_63290", "text": "const generics and lifetimes ICE | The following ICE's on _stable_, beta and nightly, even though `const_generics` is nightly only: ```Rust #![feature(const_generics)] use core::marker::PhantomData; struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); impl Bug<'_, {\"\"}> {} ```
Backtrace:::uninit()` to a local variable is usually free, even when `size_of::()` is large. However, passing it for example to `Arc::new` [causes at least one copy](https://youtu.be/F1AquroPfcI?t=4116) (from the stack to the newly allocated heap memory) e | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, requires-nightly", "label": "question", "label_id": 4} {"id": "rust_63300", "text": "ICE on generic associated type with a bound referencing the quantified type | I was reading https://varkor.github.io/blog/2019/03/28/idiomatic-monads-in-rust.html and decided to try some of the code samples, but the compiler panicked! ```rust trait Functor { type HigherSelf: Functor; } ``` Crashes with `error: internal compiler error: src/librustc | labels: I-ICE, A-associated-items, T-compiler, C-bug, F-generic_associated_types, glacier", "label": "high", "label_id": 1} {"id": "rust_63301", "text": "std::iter::Rev breaks order or operation with std::iter::Map | Hello, I've just found out that when you use `it.rev().map(...).rev()`, the two `.rev()` seem to cancel each other. While in most cases, this isn't much of an issue, it does cause problems with stuff such as this: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018 | labels: T-libs-api, C-bug, A-iterators", "label": "medium", "label_id": 2} {"id": "rust_63303", "text": "running \"./x.py test\" after \"./x.py build\" build fails | Here is the relevant part... ``` ... Testing rustc_macros stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) [0/45477] Finished release [optimized] target(s) in 0.10s Running build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps/rustc_macros-9c38a09c1d63337a running | labels: T-bootstrap, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63305", "text": "Warn on using intra-doc links on stable | It would be a significant effort to implement feature-gates in Rustdoc just for intra-doc links so I understand why that hasn't been done. However, because there is no warning I've been unintentionally creating docs with broken links on stable for a while now. I haven't observed | labels: T-rustdoc, C-enhancement, A-stability, A-intra-doc-links", "label": "question", "label_id": 4} {"id": "rust_63313", "text": "librustc/infer/lexical_region_resolve readme points to unreachable url | It's the first link here https://github.com/rust-lang/rust/blob/a6294b762859b3bb86b2a94c6857ae39beea9aeb/src/librustc/infer/lexical_region_resolve/README.md | labels: T-compiler, A-docs, A-NLL, C-bug", "label": "low", "label_id": 3} {"id": "rust_63322", "text": "Closures in const generics cause ICE | Pretty straightforward. The idea is to plug logic into a template. This seems like something that should/could work. ``` #![feature(const_generics)] fn test u32>(i: u32) -> u32 { F(i) } const F: &'static dyn Fn(u32) -> u32 = &|x| x*x; fn main () { | labels: I-ICE, A-closures, T-compiler, C-bug, A-const-generics, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_63324", "text": "Incorrect `unreachable_code` lint for loops in `try_blocks` | ```rust #![feature(try_blocks)] pub fn foo() { let _: Result<(), ()> = try { loop { // anything here } }; } ``` Here, the entire `loop` expression is reported unreachable, despite not being so. This is similar to https://github.com/rust-lang/rust/issues/54165, and probably has th | labels: A-lints, T-compiler, C-bug, requires-nightly, F-try_blocks", "label": "medium", "label_id": 2} {"id": "rust_63326", "text": "File::set_len uses an unsafe cast on Unix | Precisely, `size as off64_t`. The conversion occurs [here](https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fs.rs#L558) On my system `off64_t` is `i64`. This means that the number will overflow if larger than `i64::max_value()` and become negative. In such case, | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63329", "text": "remap-path-prefix affects dep-info | The `--remap-path-prefix` flag affects paths in dep-info files. This causes some problems witth Cargo. Cargo uses these paths to detect if any source file has been modified. Since the common use case for `--remap-path-prefix` is to rewrite to some artificial path (like `/rustc/$H | labels: A-driver, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63335", "text": "Warn about path change for `#[doc(include)]` | Recently (https://github.com/rust-lang/rust/pull/60938) the path root for `#[doc(include)]` files was changed. This change makes a lot of sense, and it's not difficult to update, but there is now a situation where code using the old path roots won't compile on new nightlies and v | labels: T-rustdoc, C-enhancement, A-diagnostics, F-external_doc", "label": "low", "label_id": 3} {"id": "rust_63336", "text": "Is the order of procedural macro attribute execution guaranteed per item? | Hiya, is there an intentional guarantee that procedural macro attributes are executed outward-in per item? To illustrate ([repo](https://github.com/azriel91/proc_macro_attribute_order)): ```rust // attr_* appends a new field to the struct #[attr_0(u8)] #[attr_1(u16)] #[attr_2(u32 | labels: A-attributes, A-macros, T-lang", "label": "medium", "label_id": 2} {"id": "rust_63339", "text": "remap-debuginfo causes some rustc tests to fail | Setting `remap-debuginfo` to `true` in `config.toml` will cause a few tests to fail. They are: - `ui/impl-trait/impl-generic-mismatch.rs` - `ui/consts/const-size_of-cycle.rs` - `ui/type_length_limit.rs` The issue is that these tests use `$SRC_DIR` in their `.stderr` output, but w | labels: A-testsuite, A-debuginfo, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_63344", "text": "Rust execute the SHELL command 'git --no-pager log --author=authorname' cannot get output", "label": "medium", "label_id": 2} {"id": "rust_63349", "text": "Recompiling causes panic | Making changes to code in modules that compile to WASM and running `cargo build --release` results in a panic. This is the project: https://github.com/paritytech/substrate Immediately running `cargo clean && cargo build --release` will allow successful compilation. Also upgrading | labels: I-ICE, P-high, T-compiler, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63351", "text": "Intra-rustdoc links do not work for all primitives | Coming from the tracking issue #43466. I'm trying to link to [`slice::rotate_left`](https://doc.rust-lang.org/std/primitive.slice.html#method.rotate_left) and it doesn't seem to be supported I tested [`pointer::is_null`](https://doc.rust-lang.org/stable/std/primitive.pointer.html | labels: T-rustdoc, E-hard, E-mentor, C-bug, A-intra-doc-links", "label": "question", "label_id": 4} {"id": "rust_63355", "text": "ICE with type_alias_impl_trait: errors selecting obligation during MIR typeck | ```rust #![feature(type_alias_impl_trait)] pub trait Foo {} pub trait Bar { type Foo: Foo; fn foo() -> Self::Foo; } pub trait Baz { type Foo: Foo; type Bar: Bar; fn foo() -> Self::Foo; fn bar() -> Self::Bar; } impl Foo for () {} impl Bar for () { type Foo = FooIm | labels: E-needs-test, T-compiler, A-impl-trait, C-bug, F-type_alias_impl_trait, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_63357", "text": "`std::iter::count` and `std::iter::count_with` functions | It would be great to have these functions, which would behave similarly to the `once` / `once_with` and `repeat` / `repeat_with` functions, except they would iterate a fixed number of times (given by a `usize`) instead of just once/infinitely. | labels: T-libs-api, C-feature-request, A-iterators", "label": "medium", "label_id": 2} {"id": "rust_63359", "text": "A way to force the compiler to accept falsely named \"Undefined behavior\" | I'm trying to execute some data in Rust, however I'm getting this error: ``` error[E0080]: it is undefined behavior to use this value --> src/main.rs:9:1 | 9 | / const executable_data: extern \"C\" fn() = unsafe { 10 | | std::mem::transmute(address) 11 | | }; | |__^ type validation | labels: T-lang, C-feature-request, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_63361", "text": "Link errors on MSVC Nightly since around 2019-07-13 | Any crate that uses `std::sync::Arc` fails to compile with a link error saying `unresolved external symbol __atomic_fetch_sub_8` Test case on `rustc 1.38.0-nightly (6a91782b7 2019-08-06)` ```rust fn main() { let test = std::sync::Arc::new(32); } ``` outputs: ``` link_error-44aa39 | labels: A-linkage, A-LLVM, O-windows, O-linux, regression-from-stable-to-nightly, T-compiler", "label": "critical_bug", "label_id": 0} {"id": "rust_63362", "text": "Inconsistent behavior between check and build when handling duplicate #[no_mangle] static values | (if this issue is better suited to rust-lang/rust, please let me know and I'll post it there) **Problem** `cargo check` and `cargo build` behave differently when handling two identically-named `#[no_mangle]` static values defined in di | labels: A-metadata, T-compiler, T-cargo", "label": "medium", "label_id": 2} {"id": "rust_63364", "text": "ICE when iterating over a `u16` range whose bounds exceed 64k | An ICE is observable with this code: ``` fn part(_: u16) -> u32 { 1 } fn main() { for n in 100_000.. { let _ = part(n); } } ``` ``` thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/librustc_lint/types.rs:79:12 note: Run with `RUST_BACKTRACE=1 | labels: E-easy, A-lints, I-ICE, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63365", "text": "Confusing error message with FnMut | https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=12bbb938650f4835979fafc55ce9c5ea ```rust fn main() { fn do_twice(mut func: F) where F: FnMut() { func(); func(); } let mut x: usize = 1; { // let add_two_to_x = || x += 2; // compliled let add_two_to_x = | labels: C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63367", "text": "'cargo check' and 'cargo build' do not behave in the same way? | ## Problem This code, why 'cargo check' can pass, but 'cargo build' can't: ```rust fn main() { let a = [1, 2, 3, 4, 5]; const INDEX: usize = 10; let element = a[INDEX]; println!(\"element is: {:?}\", element); } ``` cargo check: ``` $ cargo check Checking test v0.1.0 (/home/rust/te | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63372", "text": "\"conflicting implementations of trait\" error missing helpful note on private traits | If I write this simple, but incorrect program, rust gives me a useful output message: ```rust pub trait MyTrait {} impl MyTrait for T {} impl MyTrait for String {} ``` The output here is: ``` Compiling conflicttest v0.1.0 (/home/daboross/conflicttest) error[E0119]: confl | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63375", "text": "Confusing documentation for compile_error!() | Referring to https://github.com/rust-lang/rust/blob/db7c773a6be2f050d1d1504763819ea3916f5428/src/libcore/macros.rs#L681-L683 > It's the compiler-level form of panic!, which emits an error at runtime, rather than during compilation. It is unclear whether the \"which\" refers to \"pan | labels: C-enhancement, A-docs", "label": "low", "label_id": 3} {"id": "rust_63384", "text": "Unnecessary mul when multiplying u128 by small number | For this function ```rust pub fn mul_u128_10(a: u128) -> (u8, u128) { let (a_hi, a_lo) = (a >> 64, a & !(!0 << 64)); let (ten_a_hi, ten_a_lo) = (a_hi * 10, a_lo * 10); let (wrapped, overflow) = (ten_a_hi << 64).overflowing_add(ten_a_lo); ((ten_a_hi >> 64) as u8 + u8::from(overflo | labels: A-LLVM, I-slow, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63385", "text": "Unhelpful error message with async usage of Iterator | I'm not sure, if the behaviour itself is a bug or not, but the error message is surely not helpful. Code: ```rust #![feature(async_await)] use futures::future::FutureExt; use futures::future::TryFutureExt; use futures::stream::StreamExt; fn main() { tokio::run(function().unit_err | labels: A-diagnostics, T-compiler, A-async-await, AsyncAwait-Triaged, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_63388", "text": "`&self` lifetime elision with two parameters does not work with `async fn` | Originally reported in https://github.com/rust-lang/rust/pull/63383#discussion_r312128268. ```rust #![feature(async_await)] #![feature(nll)] // Without it you also get //~^ ERROR cannot infer an appropriate lifetime struct A; impl A { async fn foo(&self, f: &u32) -> &A { self } } | labels: A-type-system, A-lifetimes, T-compiler, A-inference, C-bug, A-async-await", "label": "question", "label_id": 4} {"id": "rust_63390", "text": "Decide whether to suggest anything when encountering `break` and expecting `!` | https://github.com/rust-lang/rust/pull/63337#discussion_r312153076 introduces suggestions when encountering `break` without a value in a context that expects a value other than `()`. In the case that the expected value is `!` we don't suggest anything. Once `!` is stabilized, we | labels: A-diagnostics, P-low, T-compiler, A-suggestion-diagnostics, F-never_type", "label": "question", "label_id": 4} {"id": "rust_63391", "text": "Improve diagnostic for `break` in `async { ... }` block | With: ```rust #![feature(async_await)] fn foo() { async { break; }; } ``` you get: ```rust error[E0267]: `break` inside of a closure --> src/lib.rs:5:9 | 5 | break; | ^^^^^ cannot break inside of a closure ``` Note how it references \"a closure\" which seems confusing for a user wh | labels: C-enhancement, A-diagnostics, T-compiler, A-async-await, AsyncAwait-Triaged, requires-nightly", "label": "low", "label_id": 3} {"id": "rust_63392", "text": "rustdoc ICE \"tried to get index of builtin macros crate\" | ``` Documenting fuchsia_vfs_pseudo_fs v0.1.0 (/b/s/w/ir/k/out/default/gen/garnet/public/rust/fuchsia-vfs/pseudo-fs/pseudo-fs) error: internal compiler error: src/librustc/hir/def_id.rs:51: Tried to get crate index of builtin macros crate thread 'rustc' panicked at 'Box', src | labels: T-rustdoc, I-ICE", "label": "high", "label_id": 1} {"id": "rust_63393", "text": "Fix ambiguity issue with associated_type_bounds | Follow up of #61738. These two particular cases could not be refactored due to an ambiguity issue: --- https://github.com/rust-lang/rust/blob/2d1a551e144335e0d60a637d12f410cf65849876/src/libcore/iter/adapters/flatten.rs#L70-L76 With `#![feature(associated_type_bounds)]` ```rust i | labels: A-associated-items, T-compiler, C-bug, E-needs-mcve, requires-nightly, F-associated_type_bounds", "label": "question", "label_id": 4} {"id": "rust_63396", "text": "Clean up `parse_bottom_expr` to use list parsing utility | _From https://github.com/rust-lang/rust/pull/63337#discussion_r312221122_ The following code should be using the common list parsing utilities: https://github.com/rust-lang/rust/blob/2d1a551e144335e0d60a637d12f410cf65849876/src/libsyntax/parse/parser.rs#L2052-L2070 CC @Centril | labels: A-frontend, C-cleanup, A-parser, T-compiler", "label": "question", "label_id": 4} {"id": "rust_63398", "text": "Wrong block referenced when emitting E0728 | The following code ([Playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3e36922f1d43ba54d23783769a15e381)) ```rust #![feature(async_await)] async fn do_the_thing() -> u8 { 8 } fn main() { let x = move || {}; let y = do_the_thing().await; } ` | labels: A-diagnostics, T-compiler, C-bug, A-async-await, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_63405", "text": "Wrong error message with closures when variable moved | https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c4b92f189e40cc2a6e8a6d13a24e4ee8 ```rust struct T(u32); fn by_value(_: T) {} fn by_ref(_: &T) {} fn main() { let z = T(123); let closure = || { by_ref(&z); by_value(z); }; closure(); by_value(z); } ``` Outpu | labels: A-diagnostics, A-closures, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63409", "text": "cleanup: remove needless reference to Instance | At least one case of this is in src/librustc_mir/interpret/snapshot.rs on line 305, but grepping is also advisable. _Originally posted by @eddyb in https://github.com/rust-lang/rust/pull/63287_ | labels: C-cleanup, T-compiler, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_63414", "text": "E0529 should suggest turning the matched `Vec` into a slice | ``` error[E0529]: expected an array or slice, found `std::vec::Vec<{integer}>` --> src/test/ui/suggestions/vec-macro-in-pattern.fixed:4:14 | LL | Some([x]) => () | ^^^ pattern cannot match with input type `std::vec::Vec<{integer}>` error: aborting due to previous error ``` CC #63 | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_63417", "text": "Building LLVM with Clang fails | In `config.toml`, under `[target.x86_64-unknown-linux-gnu]`, one can set `cc` and `cxx` to configure the C/C++ compiler used for building LLVM. When using clang/clang++, regardless of whether `use-libcxx` is set under `[llvm]`, the `LLVM_LIBSTDCXX_MIN` compile test fails due to a | labels: A-LLVM, T-compiler, T-bootstrap, C-bug", "label": "low", "label_id": 3} {"id": "rust_63422", "text": "Unexpected error in for loop: use of possibly uninitialized | The following code: ``` fn main() { let foo = 10; let result; for _i in 1..=1 { if foo == 10 { result = true; break; } match foo { 7 => { result = true; } _ => { result = false; break; } } break; } println!(\"{}\", result) } ``` yields the following error: ``` Compiling playground ", "label": "low", "label_id": 3} {"id": "rust_63430", "text": "[ICE] C-variadic functions are only valid with one or more fixed arguments | This ICEs (see title) because of the call: ```rust extern { fn foo(...); } fn main() { unsafe { foo(1, 2, 3); } } ``` That's because the definition of `foo` errored in 1.34, but doesn't since 1.35: ```rust extern { fn foo(...); } ``` cc @dlrobertson (found while working on https: | labels: A-type-system, I-ICE, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0} {"id": "rust_63434", "text": "Compilation panicked | Compilation exited abnormally when compiling [this code](https://github.com/gcao/gene.rs/blob/f861fba0d25f6a6de2f01a680bd39eebcf40b7e2/src/compiler.rs#L162) I know my code has a lot of issues but the compiler should either pass or fail instead of panicking Steps to reproduce git | labels: I-ICE, A-borrow-checker, T-compiler, C-bug, fixed-by-NLL", "label": "high", "label_id": 1} {"id": "rust_63435", "text": "Rustdoc search result links to 404 | On the following page: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/?search=niche_start clicking on any of the two search results yields a 404 error. | labels: T-rustdoc, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63436", "text": "debuginfo/empty-string.rs test failed on Linux | When I run `x.py test` on Linux, `debuginfo/empty-string.rs` test failed with the following error: ```rust Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 122 tests .iiiii..ii.....i..i...i..i.iFi..i.ii..iii. | labels: A-testsuite, O-linux, A-debuginfo, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_63438", "text": "\"Structural match\" annotations should be moved from struct/enum items to impl items | \"Structural match\" property of a type means that the constants of this type can be used in patterns (https://github.com/rust-lang/rust/issues/31434) or in const generics in the future. Right now this property can be given to a type in two ways: - `#[structural_match]` attribute, | labels: A-type-system, A-resolve, A-trait-system, A-macros, T-lang, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63439", "text": "const_prop makes RUST_CTFE_BACKTRACE unusable | The idea behind `RUST_CTFE_BACKTRACE=1` was that it should only show a backtrace (of where a Miri error originates) when an error is actually shown to the user. And that worked fine when I implemented it. But since then, something changed in const_prop, and now I get thousands of | labels: T-compiler, C-bug, A-const-eval, A-miri", "label": "medium", "label_id": 2} {"id": "rust_63443", "text": "[rustdoc] on search results, when pressing ESC, either remove text in URL or don't remove text in search bar | I think the best be the second: not removing text from search bar. | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_63444", "text": "Rustc panics with comments with non-ascii characters after an error | Running this on playground: ```rust struct A {} fn main() { let a = A; // Γ© } ``` Panics rustc: ``` Compiling playground v0.0.1 (/playground) thread 'rustc' panicked at 'byte index 44 is not a char boundary; it is inside 'Γ©' (bytes 43..45) of `struct A {} fn main() { let a = A; / | labels: A-diagnostics, I-ICE, A-parser, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63445", "text": "rustc hangs on this particular invalid `if let` syntax | The following code causes rustc to hang, consuming 100% CPU on one core, and unbounded memory until it is killed by the OOM killer: fn main() { let condition = Some(true); (if let Some(x) = condition) && x { println!(\"condition is present and true\"); } } This is the output from ` | labels: A-parser, T-compiler, C-bug, I-hang", "label": "medium", "label_id": 2} {"id": "rust_63447", "text": "Incorrect Code Generation | https://godbolt.org/z/Q0WgsL ```rust use std::os::raw::c_char; use std::ffi::c_void; const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void; extern \"C\" { fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void; } #[allow(non_camel_case_types)] type pid_t = i32; #[inline(", "label": "medium", "label_id": 2} {"id": "rust_63454", "text": "Some(..).is_some() is false for redox_syscall datastructure | When using the redox_syscall crate, the compiler fail at an `assert!(Some(..).is_some())`. This bug however is only present with the crate: locally defining the same datastructure runs perfectly. Equality still works, though, as the fields can be compared. ## Minimum reproducible", "label": "medium", "label_id": 2} {"id": "rust_63456", "text": "std::env::var and std::env::var_os do not document panic on key containing null byte | `env::remove_var` and `env::set_var` document that they panic when the key contains a null byte, but `env::var` and `env::var_os` do not document this behavior. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e43934f459b10424f374f20db846f092 | labels: A-docs", "label": "low", "label_id": 3} {"id": "rust_63457", "text": "Consider move libarena and libgraphviz out of tree | These code doesn't get touched a lot. So maybe it makes sense to move them out instead of generating auto publish packages every day. | labels: C-enhancement, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63458", "text": "incompatible types even if and else uses the same code... | ```rust error[E0308]: if and else have incompatible types --> src/main.rs:98:17 | 87 | / if query[\"size\"] != json!(-1) { 88 | | Client::new() | _|_________________- 89 | | | .post(&url) 90 | | | .json(&query) 91 | | | .send() ... | | 95 | | | }) 96 | | | .map_err(error::ErrorInte", "label": "medium", "label_id": 2} {"id": "rust_63460", "text": "Recursive macro call inside concat macro fails to find macros referred to by $crate | ```rust #[macro_export] macro_rules! separator { () => { \"/\" }; } #[macro_export] macro_rules! concat_separator { ( $e:literal, $($other:literal),+ ) => { concat!($e, $crate::separator!(), $crate::concat_separator!($($other),+)) }; ( $e:literal ) => { $e } } fn main() { println!( | labels: A-resolve, A-macros, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63466", "text": "segfault with target-feature=+soft-float | The following program currently segfaults on x86_64-unknown-linux-gnu when compiling with stable rust 1.36.0 with soft-float, and running with TARGET unset. ```rust use std::env; fn main(){ let target = env::var(\"TARGET\").unwrap(); println!(\"{}\", target); } ``` Here's the output: | labels: O-linux, P-high, T-compiler, I-unsound", "label": "critical_bug", "label_id": 0} {"id": "rust_63476", "text": "nightly version fails: invalid version 3 on git_proxy_options; class=Invalid (3) | On FreeBSD 12 amd64 rust-nightly-1.38.0.20190811_1 fails: ``` $ cargo build Updating crates.io index error: failed to load source for a dependency on `image` Caused by: Unable to update registry `https://github.com/rust-lang/crates.io-index` Caused by: failed to fetch `https://gi | labels: O-freebsd, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63477", "text": "Typo in `println` docs. | There is an unclosed parenthesis in the [docs](https://doc.rust-lang.org/std/macro.print.html) for [`println!`](https://github.com/rust-lang/rust/blob/master/src/libstd/macros.rs#L122). The line in question is [line 122](https://github.com/rust-lang/rust/blob/master/src/libstd/ma", "label": "question", "label_id": 4} {"id": "rust_63478", "text": "Lots of \"cannot find in scope\" errors can make name resolution extraordinarily slow | I missed a `use` and found a `check` that takes _over 4 minutes_ to fail. Repro: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=aaac7e403ced051c0e4165df25a455a5 time-passes blames this on \"name resolution\" | labels: A-diagnostics, A-resolve, I-compiletime, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63479", "text": "Regression: Matching on function pointers fails when one of the formal params implements custom PartialEq | A contrived [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=401774c0d5d389dc0d621608553f7e99) example: ```rust #[derive(Eq)] struct A { a: i64 } impl PartialEq for A { #[inline] fn eq(&self, other: &Self) -> bool { self.a.eq(&other.a) } } typ | labels: P-high, T-compiler, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63481", "text": "Compiler is awkwardly happy with fns without Box | Hi, I'm writing a functional programming library in Rust, and I found some weird behaviour with typing. In the below code to emulate `Apply` ``` use crate::functor::Functor; use crate::hkt::{HKT, HKT3}; pub trait Apply: Functor + HKT3 where F: FnOnce(A) ->", "label": "medium", "label_id": 2} {"id": "rust_63484", "text": "Using profile-overrides results in both optimized and unoptimized versions of the same crate in linked executable | I'm trying to use the \"profile-overrides\" feature in cargo. The tracking issue for this feature is here: https://github.com/rust-lang/rust/issues/48683 The documentation for this is here: https://doc.rust-lang.org/cargo/reference/unstable.html#profile-overrides I'm trying to buil | labels: T-cargo, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63496", "text": "ICE when trying to reference an associated trait constant | ``` trait ToBytes { const SIZE: usize; fn a(self) -> [u8; ToBytes::SIZE]; // error happens because a previous type error happened I think fn b(self) -> [u8; ToBytes::SIZE]; } ``` ## Error message `error: internal compiler error: src/librustc/traits/codegen/mod.rs:51: Encountered | labels: A-codegen, I-ICE, E-needs-test, P-medium, A-associated-items, T-compiler", "label": "high", "label_id": 1} {"id": "rust_63500", "text": "async fn methods and impl `'_` elision do not interact correctly | As [reported by @cramertj](https://github.com/rust-lang/rust/issues/63225#issuecomment-519163528), this example: ```rust #![feature(async_await)] struct Foo<'a>(&'a u8); impl Foo<'_> { async fn bar() {} } ``` currently produces this error: ``` error[E0261]: use of undeclared life | labels: A-lifetimes, T-compiler, A-inference, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2} {"id": "rust_63504", "text": "When needing type annotation do not suggest using `impl Trait` or closure | _Subset of https://github.com/rust-lang/rust/issues/63502_ When encountering ``` #![feature(async_await)] use std::io::Error; fn make_unit() -> Result<(), Error> { Ok(()) } fn main() { let fut = async { make_unit()?; Ok(()) }; } ``` Do not suggest \"consider giving `fut` the expli | labels: E-easy, A-diagnostics, P-medium, T-compiler, A-inference, C-bug", "label": "low", "label_id": 3} {"id": "rust_63506", "text": "Suggest `Box::new` on E0308 when appropriate | When encountering a boxed value as expected and a stack allocated value that could be boxed to fulfill the expectation, like in the following snippet, suggest `Box::new` wrapping: ``` fn main() { let x: Box _> = || { Err(())?; Ok(()) }; } ``` ``` error[E0308]: mismatched | labels: C-enhancement, A-diagnostics, P-low, A-closures, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_63510", "text": "Spurious expired crates.io certificate on CI | We encountered multiple spurious failures while trying to download crates from crates.io, related to an expired certificate. This is probably something happening on the CI VMs, as the crates.io certificate is expiring in a few months (maybe the clock goes back to the epoch for wh | labels: A-spurious, T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63513", "text": "Azure Pipelines sometimes doesn't report back its status to GitHub | It happened a few times that Azure Pipelines doesn't report back the build status to GitHub, causing the commits to be in a permament \"in progress\" state. For example, a few times it happened yesterday: * https://github.com/rust-lang/rust/runs/191033192 * https://github.com/rust- | labels: A-spurious, T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63514", "text": "Tracking issue for map_ok and map_err method for Poll>> | Currently map_ok and map_err methods are given for Poll>. We should provide similar methods for Poll>> as they are helpful in stream building code. --- ### Steps - [x] Implementation: https://github.com/rust-lang/rust/pull/63512 - [x] Stabilizatio | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, A-async-await", "label": "question", "label_id": 4} {"id": "rust_63516", "text": "Weird compiler behavior with in-lining of a function -> constant value arbitrary changed | Hey there, I guess I found a weird bug in the compiler in the following scenario: I do have a function with the following signature and the first part of the contents given like this: ``` pub(crate) fn send_message(channel: MailboxChannel, message: &T) -> Mailb | labels: A-LLVM, A-codegen, P-high, T-compiler, I-unsound, C-bug", "label": "question", "label_id": 4} {"id": "rust_63519", "text": "Dependencies \"can't find crate `core`\" on nightly for thumbv7em-none-eabi | The following steps will work and compile on stable, but not on nightly. # Steps to reproduce ``` rustup target add thumbv7em-none-eabi cargo new --lib compile-fail && cd compile-fail echo 'libc=\"=0.2.61\"' >> Cargo.toml # or cargo add libc@0.2.61 echo '#![no_std]' > src/lib.rs ca | labels: T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63520", "text": "run-make-fulldeps/linker-output-non-utf8 failure | when running `x.py test` locally I get errors in the test `run-make-fulldeps/linker-output-non-utf8`: ``` ---- [run-make] run-make-fulldeps/linker-output-non-utf8 stdout ---- error: make failed status: exit code: 2 command: \"make\" stdout: ----------------------------------------- | labels: A-linkage, A-testsuite, P-medium, T-compiler, T-bootstrap", "label": "medium", "label_id": 2} {"id": "rust_63523", "text": "Any rust-related command opens non-unicode file called \"cargo\" or \"rustup\" | When using any of the rust related commands, it opens a file that has 3 identifiable characters at the top and a mixed amount of bullcrap in the rest. \"ELF\" is at the top. Please take a look for yourself cause It's causing me tons of problems. [rustup.txt](https://github.com/rust", "label": "medium", "label_id": 2} {"id": "rust_63526", "text": "Include type bindings on string representation of `impl Trait` | _Follow up to https://github.com/rust-lang/rust/pull/63507#discussion_r313287274_ Include type arguments for traits when displaying `impl Trait`. For example, the following: ``` error[E0282]: type annotations needed for `impl std::future::Future` --> $DIR/cannot-infer-async-enabl | labels: C-enhancement, A-diagnostics, T-compiler, A-async-await, AsyncAwait-Triaged", "label": "question", "label_id": 4} {"id": "rust_63532", "text": "Date time chronology calendar JSR-310 capabilities within rust | I understand JSR-310 was mentioned earlier. I understand others have mentioned this as issue on github, but why has the issue been closed when I haven't seen the capabilities as being implemented yet? If they have been implemented, please indicate where they are. Thank you https:", "label": "medium", "label_id": 2} {"id": "rust_63533", "text": "Improve error message for `.await` in 2015 edition | Trivial example: ```rust fn f(x: std::pin::Pin<&mut dyn std::future::Future>) { x.await; } ``` Output on current nightly: ``` error[E0609]: no field `await` on type `std::pin::Pin<&mut dyn std::future::Future>` --> src/lib.rs:2:7 | 2 | x.await; | ^^^^^ unk | labels: A-type-system, C-enhancement, A-diagnostics, T-compiler, A-async-await", "label": "low", "label_id": 3} {"id": "rust_63536", "text": "ICE on roman numeral macro example | ## Description of Problem I'm trying to run the roman numeral compiler plugin code in the documentation ([here](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html)). The compiler panics with this error: ``` thread 'rustc' panicked at 'cannot access a sc", "label": "high", "label_id": 1} {"id": "rust_63547", "text": "CI is shown stuck on github | The CI seems to be stuck on Github and jobs are shown running for more than a day but it has actually completed in Azure. ![Capture](https://user-images.githubusercontent.com/22871609/62998376-f2368600-be88-11e9-9216-d2617dc8b754.PNG) ![Capture](https://user-images.githubusercont", "label": "medium", "label_id": 2} {"id": "rust_63550", "text": "thread 'main' has overflowed its stack | There're something wrong with my code , but I don't know why ? Please help me , thx very much! ``` use std::collections::HashMap; enum SyntaxKind { Unknown, } impl std::fmt::Display for SyntaxKind { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, \"{}\", ", "label": "medium", "label_id": 2} {"id": "rust_63551", "text": "Codegen backend handles compare binops for the unit type | https://github.com/rust-lang/rust/blob/c43d03a19f326f4a323569328cc501e86eb6d22e/src/librustc_codegen_ssa/mir/rvalue.rs#L586-L592 libcore however doesn't use those for the implementations for `PartialEq` and `PartialOrd` for the unit type. https://github.com/rust-lang/rust/blob/c4 | labels: E-easy, C-cleanup, A-codegen, E-mentor, T-compiler, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_63552", "text": "Codegen forgets array size when used with iterators | Consider these three functions: ``` pub fn in_range1(x: [usize; 3], m: usize) -> bool { (x[0] < m) && (x[1] < m) && (x[2] < m) } pub fn in_range2(x: [usize; 3], m: usize) -> bool { for k in &x { if *k >= m { return false; } } true } pub fn in_range3(x: [usize; 3], m: usize) -> bo | labels: A-LLVM, I-slow, P-medium, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63555", "text": "Sporadic linker failure | I compiled a rather large project and got the error below: ``` error: linking with `cc` failed: exit code: 1 | = note: \"cc\" \"-Wl,--as-needed\" \"-Wl,-z,noexecstack\" \"-m64\" \"-L\" \"/home/alice/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib\" | labels: A-linkage, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63562", "text": "Linking with extern function in Wasm | I am trying to use functions from an external module and importing them like that: ```rust #[link(wasm_import_module = \"sqlite\")] extern \"C\" { #[link_name=\"allocate\"] pub fn allocate_external(size: usize) -> i32; #[link_name=\"deallocate\"] pub fn deallocate_external(ptr: i32, size | labels: A-linkage, T-compiler, O-wasm", "label": "medium", "label_id": 2} {"id": "rust_63566", "text": "Meta tracking issue for RFC 1892, \"Deprecate uninitialized in favor of a new MaybeUninit type\" | This issue tracks the progress of `MaybeUninit` in general. The type was introduced in https://github.com/rust-lang/rfcs/pull/1892. The old tracking issue is https://github.com/rust-lang/rust/issues/53491. This issue is not for discussion about specific extensions to `MaybeUni | labels: metabug, T-lang, T-libs-api, C-tracking-issue, Libs-Tracked, A-raw-pointers", "label": "question", "label_id": 4} {"id": "rust_63567", "text": "Tracking issue for `#![feature(maybe_uninit_extra,const_maybe_uninit_write)]` | This is a tracking issue for the RFC \"Deprecate `uninitialized` in favor of a new `MaybeUninit` type\" (rust-lang/rfcs#1892). This issue specifically tracks the following unstable methods: ```rust impl MaybeUninit { pub unsafe fn assume_init_read(&self) -> T { ... } pub unsa | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_63568", "text": "Tracking issue for `#![feature(maybe_uninit_ref)]` | This is a tracking issue for the RFC \"Deprecate `uninitialized` in favor of a new `MaybeUninit` type\" (rust-lang/rfcs#1892). This issue specifically tracks the following unstable methods: ```rust impl MaybeUninit { pub unsafe fn assume_init_ref(&self) -> &T { ... } pub unsa | labels: T-lang, T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "medium", "label_id": 2} {"id": "rust_63569", "text": "Tracking issue for `#![feature(maybe_uninit_slice)]` | This is a tracking issue for the RFC \"Deprecate `uninitialized` in favor of a new `MaybeUninit` type\" (rust-lang/rfcs#1892). Most of this has been stabilized, this issue now only tracks the below unstable methods. ### Public API ```rust impl [MaybeUninit] { pub unsafe fn as | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, requires-nightly", "label": "question", "label_id": 4} {"id": "rust_63576", "text": "Implement @argsfile to read arguments from command line | Many tools, such as gcc and gnu-ld, support \"args files\" - that is, being able to specify @file on the command line. Implemented in https://github.com/rust-lang/rust/pull/63175 This implements a straightforward form where each argument is on a separate line in a text file. This a | labels: A-driver, T-compiler, C-tracking-issue, disposition-merge, finished-final-comment-period, A-CLI", "label": "question", "label_id": 4} {"id": "rust_63578", "text": "SIGSTKSZ may be too small to handle stack overflow exact CPU model and the Linux version | [This ticket shows](https://bugs.python.org/issue21131) that python's test_faulthandler.test_register_chain() crashed on ppc64 and ARM64 on Linux 3.10 and newer. It seems that rust has the [same problem](https://github.com/rust-lang/rust/blob/c43d03a19f326f4a323569328cc501e86eb6d | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_63581", "text": "`miri` no longer builds after rust-lang/rust#63575 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63575, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have tim | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63585", "text": "Cleanup: Use `#[rust_intrinsic]` and nix `rust-intrinsic` et. al | Per @eddyb's suggestion (https://github.com/rust-lang-nursery/reference/pull/652#discussion_r314206468): > Not sure these should be documented, we've been meaning to remove all 3 for years... > cc @oli-obk at least for intrinsics we could maybe have an intermediary stage where we | labels: C-cleanup, T-compiler, A-intrinsics", "label": "question", "label_id": 4} {"id": "rust_63589", "text": "Removing the exact lint count from the readme? | Addition and deprecation of multiple lints in a short period of time has regularly caused merge conflicts because of the exact lint count at the top of the README: `There are 310 lints included in this crate!` Does anyone feel like the exact count is worth having? Removing the ex", "label": "medium", "label_id": 2} {"id": "rust_63590", "text": "CStr::from_ptr should be documented to not allow strings bigger than isize::MAX | In #53784, `slice::from_raw_parts` was documented to not allow slices larger than `isize::MAX` bytes. However, `CStr::from_ptr` is not documented to have the same requirement, despite allowing the user to obtain a slice larger than `isize::MAX` bytes with its `to_bytes` method. | labels: C-enhancement, A-FFI, A-docs", "label": "low", "label_id": 3} {"id": "rust_63591", "text": "Combination of TAIT and ATB does not allow projection (unsatisfied bound) | This should pass but does not: ```rust // check-pass #![feature(associated_type_bounds)] #![feature(type_alias_impl_trait)] fn main() {} trait Bar { type Assoc; } trait Thing { type Out; fn func() -> Self::Out; } struct AssocIsCopy; impl Bar for AssocIsCopy { type Assoc = u8; } i | labels: T-compiler, C-bug, F-type_alias_impl_trait, F-associated_type_bounds", "label": "medium", "label_id": 2} {"id": "rust_63593", "text": "Rust treat Self as dynamic when it shouldn't | Here is a sample code: ```rust trait Inner {} trait MyTrait { fn something>(i: I); } ``` Which fails to compile with > error[E0277]: the size for values of type `Self` cannot be known at compilation time --> src/lib.rs:4:5 | 4 | fn something>(i: I | labels: A-trait-system, A-associated-items, T-compiler, C-bug, requires-nightly, F-associated_type_defaults", "label": "medium", "label_id": 2} {"id": "rust_63594", "text": "Incorrectly-/Un-spanned error with `type Out = Box>;` | With the following, the error appears in the wrong place (1), while it should be at (2). ```rust //~ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied // (1) --^ #![feature(associated_type_bounds)] fn main() {} trait Bar { type Assoc; } trait Thing { | labels: A-diagnostics, A-associated-items, T-compiler, C-bug, F-associated_type_bounds", "label": "medium", "label_id": 2} {"id": "rust_63597", "text": "document that target features are unsafe | When discussing https://github.com/rust-lang/rust/issues/63466 in the compiler team triage meeting, it became clear that target-features ought to be considered generally unsafe. We should document this fact in the `-Chelp` and in the [rustc book](https://doc.rust-lang.org/rustc/i | labels: P-medium, T-compiler, A-docs", "label": "low", "label_id": 3} {"id": "rust_63598", "text": "Confusing error message with lifetime in trait | [Given](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=381d0b8ca9363a314dd16bef11da7c4d): ```rust #![feature(async_await)] trait Foo<'a> {} async fn foo() { unimplemented!(); } ``` ``` error[E0637]: `&` without an explicit lifetime name cannot be | labels: A-diagnostics, A-lifetimes, A-trait-system, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63599", "text": "Stabilize RFC 2451, re-rebalance coherence | # Stabilization Proposal I am writing to propose we stabilize the implementation of [RFC 2451], \"re-rebalancing coherence\" ([tracking issue]). [RFC 2451]: https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html [tracking issue]: https://github.com/rust-lang/rust/issue | labels: T-lang, disposition-merge, finished-final-comment-period, F-re_rebalance_coherence", "label": "medium", "label_id": 2} {"id": "rust_63601", "text": "`miri` no longer builds after rust-lang/rust#63592 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63592, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have tim | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63605", "text": "1.37 source component packaging looks different from previous versions | Hi, Apologies if reporting this here isn't the most appropriate place, but thought someone else may run into it as well. It appears there're some material differences in how the Rust 1.37 release is packaged, namely around the source download. The [tarball](https://static.rust-la | labels: T-infra, C-bug", "label": "question", "label_id": 4} {"id": "rust_63608", "text": "SIGSEGV on arm | Hello. I've been directed to create a issue here after a talk on one of the rust discord servers. Hopefully I got right. So I'm trying to compile one of my projects on a Raspberry Pi. ``` nightly-armv7-unknown-linux-gnueabihf (default) rustc 1.38.0-nightly (c43d03a19 2019-08-14) | labels: I-crash, O-Arm, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63616", "text": "Handle partial initialization correctly in generators | Problem: consider something like the following, ```rust let gen = || { let _x = (yield 5; panic!()); }; ``` This can result in a local saved in our generator of type `((), !)`, which is partially initialized across the yield. In the layout code we claim that fields are all fully | labels: C-enhancement, T-compiler, A-MIR, A-coroutines, A-async-await, AsyncAwait-Triaged", "label": "low", "label_id": 3} {"id": "rust_63619", "text": "Confusing error message when a trait bound is unsatisfied due to lack of mutability | In this code, `fp` should have been declared as a mutable reference, and the compiler gives you a nice clear error message saying so: ```rust use std::env::args; use std::fs::File; use std::io::{stdout, Write}; fn main() { let mut args = args(); let _ = args.next(); let dest = ar | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63622", "text": "Short-circuit behavior and order in expressions results in 15x performance difference? | I have just started playing with Rust again via Project Euler Problem 4 and I noticed some interesting short-circuit behavior in expressions. In the two functions below, `v2()` is approximately 15 times faster than `v1()` just due to the ordering in the `if`. It's great that ther", "label": "medium", "label_id": 2} {"id": "rust_63623", "text": "[llvm build] Host compiler must support std::atomic | I cannot build rustc locally with commit f7af19c279. The build log is: ```bash % ./x.py test src/test/ui --pass check Updating only changed submodules Submodules updated in 0.06 seconds Finished dev [unoptimized] target(s) in 0.21s Building stage0 std artifacts (x86_64-unknown-li | labels: T-compiler, T-bootstrap", "label": "question", "label_id": 4} {"id": "rust_63626", "text": "C FFI functions have incorrect signatures in wasm bundle when targeting wasm32-unknown-unknown | We have a crate called `mruby-sys` which uses the `cc` crate to build a C static library. Building this library fails to link when building the `wasm32-unknown-unknown` target due to function signature mismatches. When using the same build process for the C code with clang-8, the | labels: A-FFI, T-compiler, O-wasm", "label": "medium", "label_id": 2} {"id": "rust_63628", "text": "Crater runs for Rust 1.38.0 | cc @rust-lang/release | labels: S-waiting-on-review", "label": "medium", "label_id": 2} {"id": "rust_63629", "text": "Wasm bundle for sys crate with FFI exports is empty | I'm trying to compile [`mruby-sys`](https://github.com/artichoke/artichoke/tree/master/mruby-sys) to wasm. `mruby-sys` builds a C static library using the `cc` crate. `cc` generates two wasm files, one of which I can't read with `0000004: error: bad magic value` error. The other | labels: A-FFI, T-compiler, O-wasm, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63646", "text": "`RangeToInclusive` code-generation much worse than equivilent `RangeTo` | I have two copies of the exact same code, one using `for _ in 0..65` and the other using `for _ in 0..=64`. The `0..65` one optimizes down to very simple code, however the `0..=64` version ends up emitting a large amount of unnecessary code. --- # RangeTo example ```rust pub fn a | labels: I-slow, A-codegen, E-needs-test, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63651", "text": "Macro-generated macro can no longer be called | The following crate no longer compiles as of the most recent nightly. The relevant commit range is f7af19c27...bdfd698f3. Mentioning @petrochenkov @matthewjasper because #63535 sounds relevant – is this an intentional change? #### Cargo.toml ```toml [package] name = \"repro\" | labels: A-resolve, A-macros, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63652", "text": "Causing stack overflow by calling to_string in Display trait implementation | As a mentor on exercism.io I came across the following code: ``` impl Display for Clock { fn fmt(&self, f: &mut Formatter<'_>) -> Result { write!(f, \"{}\", self.to_string()) } } ``` This causes a stack overflow: The reason for that being that **to_string** is automatically impleme | labels: C-enhancement, A-lints, T-lang, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63656", "text": "Expose llvm.ptrmask intrinsic | LLVM recently added a ptrmask intrinsic, intended for use with tagged pointers: https://llvm.org/docs/LangRef.html#llvm-ptrmask-intrinsic It allows masking off bits from a pointer without going through ptrtoint/inttoptr and breaking alias analysis in the process. We might want to | labels: A-LLVM, T-lang, T-libs-api, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63660", "text": "Deduplicate closures | https://github.com/rust-lang/rust/pull/62429 manually deduplicated monomorphizations of closures. We should automate this during building instead of requiring users to do it manually. Ideally we'll revert the parts of #62429 that made things less readable as the last step of clos | labels: C-enhancement, A-codegen, A-closures, T-compiler, A-MIR, I-heavy", "label": "low", "label_id": 3} {"id": "rust_63663", "text": "dist-x86_64-freebsd fails when building with debug assertions | Steps to reproduce: 1. Run `src/ci/docker/run.sh dist-x86_64-freebsd` (note that `DEPLOY=1` is *not* set, which is why we don't see this on Azure) 2. Observe the following ICE ([full log](https://gist.github.com/Aaron1011/244ec6c1126e433767e117b7d22186fe)): ``` Building stage1 st | labels: I-ICE, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63665", "text": "Fn coercion rules seem inconsistent | Consider the following code (which compiles; [playground](https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=8902809bc4f0bf6a0752131d9695eda9)): ``` fn f(_: usize) { unimplemented!(); } fn main() { let err = Err(()); f(err.unwrap_or_else(err_exit)); unreach", "label": "medium", "label_id": 2} {"id": "rust_63668", "text": "Panic in 'safe' extern \"C\" causes SIGILL | Investigating a SIGILL in a _safe_ library of ours I could reduce the crash to the following code: ```rust #![deny(unsafe_code)] extern \"C\" fn crash() { panic!(\"End of the world\"); } fn main() { // This works ... std::panic::catch_unwind(|| panic!(\"Oh no\")); // This will cause a ", "label": "medium", "label_id": 2} {"id": "rust_63673", "text": "`miri` no longer builds after rust-lang/rust#63658 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63658, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @RalfJung, do you think you would have ti | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63677", "text": "rustc crash with type alias of impl trait | I cannot provide a simple repro yet. But what I did is mostly define a type alias of an impl trait and use it as generic parameter of another type. And here is the stack trace ``` error: internal compiler error: src/librustc/traits/coherence.rs:523: ty_is_local invoked on unexpec | labels: A-type-system, I-ICE, A-trait-system, T-compiler, A-impl-trait, C-bug", "label": "high", "label_id": 1} {"id": "rust_63679", "text": "Redundant semicolons are parsed as an empty tuple semicolon statement | ```rust fn foo() { let _ = 3;;;; } ``` Given the above example, the rustc parser used to silently drop the redundant semicolons (`;;;`) from the AST. However, recently the parse has changed how it treats the redundant semicolons - they are now parsed as a semicolon statement with | labels: A-parser, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63680", "text": "#![macro_use] triggers unused attributes warning | Replacing `#[macro_use] mod foo;` with `#![macro_use]` inside foo.rs triggers unused attribute warning even if it is necessary. Using rustc 1.39.0-nightly (2111aed0a 2019-08-17). | labels: A-lints, A-resolve, A-macros, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63685", "text": "hygiene: cannot find macro `foo!` in this scope | This code ([playpen]) compiles on stable but not on nightly and beta: ```rust macro_rules! foo { () => { \"foo\" }; } macro_rules! bar { () => { foo!() }; } fn main() { println!(bar!()); } ``` [playpen]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=8b3bc | labels: A-resolve, A-macros, T-compiler, regression-from-stable-to-beta, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63687", "text": "gfx_device_gl 0.16.1 broken on latest nightly | Caused by #63613. To be precise the https://github.com/rust-lang/rust/pull/63613/files#diff-c915449964a130718bd732c4f035b2cfR101 change. It basically does: ```rust extern crate gfx_core as core; format!(...); ``` Because `format!` uses `::core::format_args` to refer to `format_ar | labels: A-resolve, A-macros, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63690", "text": "Diagnostics could be better for unclosed delimiters | Depending on where the unclosed delimiter is in the file, you can get dozens or even hundreds of meaningless errors after the unclosed delimiter. Since terminals display the last output from a program, this means that the actual error gets completely buried. This afternoon I had | labels: C-enhancement, A-diagnostics, A-parser, T-compiler, WG-diagnostics, D-papercut", "label": "low", "label_id": 3} {"id": "rust_63694", "text": "core::ffi::c_void is marked as \"stable since 1.1\", but it was added in 1.30 | The title says it all really. * Missing `ffi` entirely: https://doc.rust-lang.org/1.29.0/core/ * Present in the new `ffi` module: https://doc.rust-lang.org/1.30.0/core/ffi/index.html | labels: A-FFI, A-stability, T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63695", "text": "ICE caused by using a const_generic fn from a trait or impl | A function that compiles and runs successfully outside of a trait causes an ICE when it's in a trait. The expectation is that this should work similarly to other generics on trait functions--while they will prevent a trait object reference, they should otherwise be allowed. (On [ | labels: I-ICE, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_63696", "text": "Invalid value lint not firing | @RalfJung why is the invalid value lint not firing here? https://github.com/glium/glium/blob/9248e31f8bb76e972021c4d73ee53c59ecfe0364/src/context/mod.rs#L727 The type of the input param to that function is `extern \"system\" fn(u32, u32, u32, u32, i32, *const i8, *mut std::ffi::c_v", "label": "medium", "label_id": 2} {"id": "rust_63697", "text": "Compiler suggests unnecessary try into | I updated a dependency and the type of a struct field changed from an `i32` to a `u16`. I am assigning a `u16` value to this struct field. Before, I was calling `i32::from` to convert the `u16` to an `i32`. With the upgrade this is unnecessary since the field and the value are bo | labels: E-easy, C-enhancement, A-diagnostics, P-medium, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_63706", "text": "rustc suggests invalid syntax for missing method on `impl Trait` parameter | [Given:](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ea23b1a629ffaed2249b6680002d47f1) ```rust trait Foo {} trait Bar { fn hello(&mut self) {} } fn test(foo: &mut impl Foo) { foo.hello(); } ``` rustc outputs: ``` error[E0599]: no method named `hello` | labels: T-compiler, A-impl-trait, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_63707", "text": "window.hashchange is not a function | When selecting Rust source code with either the latest stable or the latest nightly, the following is seen: ``` main-20190703-1.36.0-a53f9df32.js:1 Uncaught TypeError: window.hashchange is not a function at set_fragment (main-20190703-1.36.0-a53f9df32.js:1) at HTMLDocument.docume | labels: T-rustdoc, C-bug", "label": "low", "label_id": 3} {"id": "rust_63708", "text": "Debug implementaton for `&(x: impl Debug)` should prepend `&` | dbg! is not displaying the type correctly for reference objects/variables. Comment here: https://www.reddit.com/r/rust/comments/cp8y58/hey_rustaceans_got_an_easy_question_ask_here/ex76hhq/ Code here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ed9fb664 | labels: C-enhancement, T-libs-api", "label": "question", "label_id": 4} {"id": "rust_63710", "text": "rustdoc renders re-exported `async fn`s incorrectly | Relates to #58027, but this is the case where an async fn is re-exported by another crate. The docs for the original function shows `async fn` but the re-export shows `fn -> impl Future`. Example: - [Original function](https://docs.rs/tokio-sync/0.2.0-alpha.2/tokio_sync/mpsc/stru | labels: T-rustdoc, C-bug, A-async-await, AsyncAwait-Polish", "label": "low", "label_id": 3} {"id": "rust_63711", "text": "Suggest setting associated types on type errors | [The following code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=4c099411a96bcca3c01e682ca92e8175) is missing a constraint for `TryInto`: ``` use std::convert::TryInto; struct TryIntoError; struct X; impl TryInto for X { typ | labels: C-enhancement, A-diagnostics, P-medium, A-associated-items, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_63712", "text": "E0267 is used twice in different `struct_span_err` calls | The following code https://github.com/rust-lang/rust/blob/1e02bc62bc72d2145a9f11c740714a1a5d94e2b4/src/librustc_passes/loops.rs#L175-L184 Should either assign a new error code to the `AsyncClosure` case, or move the common code to a closure and call it from those two branches to | labels: E-easy, C-cleanup, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63713", "text": "Create a deterministic `FxHashMap` wrapper | It should not provide iteration support, but only insert/remove/get/get_mut and convertion to a sorted vec. We should then use it where possible This could prevent accidentially causing hashmap related non determinism in most cases. _Originally posted by @bjorn3 in https://github | labels: E-easy, C-cleanup, C-enhancement, P-medium, T-compiler, A-reproducibility", "label": "question", "label_id": 4} {"id": "rust_63716", "text": "[bug] async specialization is not parsed | The `async` keyword doesn't seem to currently work with specialization (namely `default fn`). The order of keywords does not matter β€” I'm not sure which it's supposed to be. Minimal example from @dtolnay in dtolnay/async-trait#25: ```rust macro_rules! item { ($i:item) => {} } ite | labels: A-parser, T-compiler, A-specialization, C-bug, A-async-await, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_63719", "text": "Strange E0505 error ... is this a bug? | Hey Folks, So, I've been fuzz testing `rustc` nightly using a range of generated programs and am digesting the findings. This one stood out to me: ``` fn main() { let mut x = 1; { let mut y = &mut x; y = y; y; } x; } ``` This currently reports an E0505 on the playground and Rust | labels: T-lang", "label": "medium", "label_id": 2} {"id": "rust_63724", "text": "Silence `unused_import` warning on unresolved import | `use Foo::*;` will cause the following output: ``` error[E0432]: unresolved import `Foo` --> src/lib.rs:1:5 | 1 | use Foo::*; | ^^^ use of undeclared type or module `Foo` warning: unused import: `Foo::*` --> src/lib.rs:1:5 | 1 | use Foo::*; | ^^^^^^ | = note: `#[warn(unused_impor | labels: C-cleanup, C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63727", "text": "offline docs doesnot show symbols proper on firefox | The offline docs does not show symbols properly such as navigation to previous page, next page, table of content, change theme, search and print this book in firefox browser only. tried > rustup docs --book opened docs in firefox. //version > rustc --version --verbose rustc 1.37.", "label": "low", "label_id": 3} {"id": "rust_63728", "text": "missing specialization: `>::specialized_encode` not overridden | The following code when compiled with `-Z ast-json` causes ICE: ```rust pub fn main() { let a = [\"1\", \"lol\", \"3\", \"NaN\", \"5\"]; let element: Option = a.iter().filter_map(|s| s.parse().ok()).next(); assert_eq!(element, Some(1)); } ``` Error: ```rust % RUST_BACKTRACE=1 cargo ru | labels: I-ICE, T-compiler, A-specialization, C-bug, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_63729", "text": "`rls` no longer builds after rust-lang/rust#62727 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#62727, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @SimonSapin, do you think you would have ti | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63733", "text": "Incorrect overflowing literals error with saturating_sub | ```rust fn main() { assert_eq!(i8::min_value(), -128i8); println!(\"{}\", -128i8.saturating_sub(-1)); } ``` ([Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=17140f6c272a402083da3ce128c17221)) Errors: ``` Compiling playground v0.0.1 (/playground) | labels: C-enhancement, A-lints, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63734", "text": "Misspelled test name \"ui/non-interger-atomic.rs\" | ```diff -ui/non-interger-atomic.rs +ui/non-integer-atomic.rs ``` | labels: E-easy, A-testsuite, C-bug", "label": "low", "label_id": 3} {"id": "rust_63735", "text": "[Feature request] Compiler might automatically pick a concrete type for generic Option | Hello Rust developers, My versions are: - rustc: `1.37.0 (eae3437df 2019-08-13)` - Cargo: `1.37.0 (9edd08916 2019-08-02)` Currently this does not compile: ```rust use std::path::Path; fn test

(_: Option

) where P: AsRef {} fn main() { test(None); } ``` Error message: `` | labels: T-lang, needs-rfc", "label": "medium", "label_id": 2} {"id": "rust_63741", "text": "Suggest removing `self` import when not in a list | ```rust use std::self; // error[E0429]: `self` imports are only allowed within a { } list ``` we should offer the suggestion to remove `::self`, as this is likely what the user intended. This issue has been assigned to @mib | labels: E-easy, C-enhancement, T-lang, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_63748", "text": "Tracking issue for `linux_syscall` | PR: #63745 Unresolved questions: - [ ] Should we add syscalls to `core` or keep only in `std`? - [ ] Do we still need the workaround for `syscall6` on x86? | labels: O-linux, T-lang, T-libs-api, B-unstable, C-tracking-issue", "label": "question", "label_id": 4} {"id": "rust_63751", "text": "Check stdout/stderr of run-pass run portion | We currently check the compiler's output, but it's sometimes useful to check that the run-pass test itself is outputting the same as before. In particular, @tmandry expressed a desire to test libtest in this fashion. Taking a look at the code, we probably want to add another head | labels: A-testsuite, E-mentor", "label": "medium", "label_id": 2} {"id": "rust_63757", "text": "stable rustc panics on adding/removing `dyn` before a trait in a proc macro | I was doing a small change to someone's crate, and encountered a crash. The weird thing is also that the crash is fixed by doing simple `cargo clean`, i.e. the problem was probably not in the code, but in the way `rustc` (or `cargo`) handles it between runs. rustc 1.37.0/rustc 1. | labels: I-ICE, T-compiler, A-incr-comp, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63758", "text": "Implementation of Ord for integers is suboptimal | The current implementation of `Ord::cmp` for integral types results in less than optimal code. Currently the implementation looks something like this: ```rust fn cmp(&self, other: &$t) -> Ordering { if *self == *other { Equal } else if *self < *other { Less } else { Greater } } ` | labels: E-easy, I-slow, C-enhancement, E-mentor, T-libs-api, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_63764", "text": "Custom diagnostic for bad `mut` in pattern with sub-bindings | Given (as brought up in https://github.com/rust-lang/rust/pull/63693#discussion_r315926681 CC @Centril): ``` pub fn main() { struct Foo { x: isize } let mut Foo { x: x } = Foo { x: 3 }; } ``` [We currently emit a parse error](https://play.rust-lang.org/?version=stable&mode=debug& | labels: C-enhancement, A-diagnostics, P-low, T-compiler, A-suggestion-diagnostics", "label": "question", "label_id": 4} {"id": "rust_63765", "text": "Panic while running rustdoc on polonius-engine | I get a panic ~in beta~ at least as far back as 1.31 while attempting to compile the documentation in [rust-lang/polonius](https://github.com/rust-lang/polonius) (seems to stem from polonius-engine) ``` $ RUST_BACKTRACE=full cargo doc --open Documenting polonius-engine v0.9.0 (/h | labels: T-rustdoc, I-ICE, C-bug", "label": "high", "label_id": 1} {"id": "rust_63769", "text": "Are all AVX-512 SIMD functions and types available in Rust `std::arch` module? | Hello! We are developing our game engine (esp. deserialization and noise generation part) in Rust, which theoretically can make good use of modern SIMD features. There could be relevant x86 CPUs available in market with latest AVX-512 instructions, and as we may concern Rust shou | labels: A-SIMD", "label": "question", "label_id": 4} {"id": "rust_63773", "text": "[Const generics] thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued' | The code simply does \"not\" compile, because compiler crashes. I tried this code: ```rust #![feature(const_generics)] fn test() { println!(\"{} {}\", A, B); } fn main() { test::<\"Hello\", \"World\">(); } ``` Which is expected to compile wit | labels: I-ICE, T-compiler, C-bug, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_63778", "text": "Temporary values do not outlive a direct await | ```rust struct Test(String); impl Test { async fn borrow_async(&self) {} fn borrow(&self) {} fn with(&mut self, s: &str) -> &mut Self { self.0 = s.into(); self } } async fn test() { // error[E0716]: temporary value dropped while borrowed Test(\"\".to_string()).with(\"123\").borrow_as | labels: A-lifetimes, T-lang, A-async-await", "label": "medium", "label_id": 2} {"id": "rust_63783", "text": "rustc 1.37.0 panic | While running clippy rustc panicked. The code is here https://github.com/AxelNennker/indy-sdk/tree/vcx_clippy To reproduce: - `git clone https://github.com/AxelNennker/indy-sdk` - `git checkout vcx_clippy` - `cargo clippy --manifest-path vcx/libvcx/Cargo.toml -- -W clippy::style ", "label": "high", "label_id": 1} {"id": "rust_63785", "text": "Compiler symbol resolution works when it shouldn't | So here is the code that works when it shouldn't: ```rust let m = unsafe { mem::transmute::<&mut [u8], &mut [u32]>(&mut chunk) }; #[cfg(target_endian = \"big\")] for j in 0..16 { M[j] = M[j].swap_bytes(); } ``` And this doesn't work, as expected. ```rust let m = unsafe { mem::trans", "label": "medium", "label_id": 2} {"id": "rust_63787", "text": "Ref parameter incorrectly decorated with `noalias` attribute | The following library: ```rust use std::cell::*; pub fn break_it(rc: &RefCell, r: Ref<'_, i32>) { // `r` has a shared reference, it is passed in as argument and hence // a barrier is added that marks this memory as read-only for the entire // duration of this function. drop( | labels: A-codegen, T-lang, T-libs-api, I-unsound, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63791", "text": "Miscompilation under target-cpu >= haswell | This example fails when compiled with `target-cpu` \"haswell\" or more recent: ```toml [dependencies] aes-soft = \"=0.3.3\" ``` ```rust use aes_soft::{block_cipher_trait::BlockCipher, Aes128}; fn main() { let plain = [127, 0, 0, 1, 174, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; let key = [0; | labels: A-LLVM, O-x86_64, P-high, T-compiler, regression-from-stable-to-stable, I-unsound", "label": "critical_bug", "label_id": 0} {"id": "rust_63792", "text": "`as_slice` -> `as_str` in the docs | `core::str::Str.as_slice()` has been renamed to `as_str()` as discussed in https://github.com/rust-lang/rust/issues/14433, but the old name is still referenced in the docs: https://github.com/rust-lang/rust/blob/18630677cf6c7ac50e6786c504b35bc09501dbe2/src/libstd/primitive_docs.r | labels: E-easy, C-enhancement, A-docs", "label": "low", "label_id": 3} {"id": "rust_63794", "text": "unimplemented macro doesnt compile with RPIT | I believe the following should compile but doesn't. ``` trait Foo {} fn bar() -> impl Foo { unimplemented!() } ``` I get the following error: ``` --> src/main.rs:7:13 | 7 | fn bar() -> impl Foo { | ^^^^^^^^ the trait `Foo` is not implemented for `()` | = note: the return type of | labels: T-lang, C-feature-request, A-impl-trait", "label": "medium", "label_id": 2} {"id": "rust_63795", "text": "thread 'rustc' panicked at 'no entry found for key', src/libcore/option.rs:1166:5 | ``` thread 'rustc' panicked at 'no entry found for key', src/libcore/option.rs:1166:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. thread '' panicked at 'assertion failed: `(left == right)` left: `LLVMing`, right: `Codegenning`', src/lib", "label": "high", "label_id": 1} {"id": "rust_63797", "text": "&str->String in the docs | This chunk was supposedly copy-pasted as is from `std::str::from_utf8` https://github.com/rust-lang/rust/blob/bdfd698f37184da42254a03ed466ab1f90e6fb6c/src/liballoc/string.rs#L430-L432 It should read A String ([`String`]) is made of bytes | labels: E-easy, A-docs", "label": "low", "label_id": 3} {"id": "rust_63798", "text": "[1.38] `#[bench]` accepted on stable but not beta | Initially reported by @e-oz [here](https://github.com/rust-lang/rust/issues/50297#issuecomment-523657376). [[playground](https://play.rust-lang.org/?version=beta&mode=debug&edition=2018&gist=b006497caba8892a0350a517d49c7a2d)] ```rust fn main() { println!(\"Hello, world!\"); } #[ben | labels: A-stability, P-high, T-lang, regression-from-stable-to-beta, T-dev-tools, A-libtest", "label": "critical_bug", "label_id": 0} {"id": "rust_63799", "text": "Confusing E0425 error when referencing undefined name with ::foo | Test program: ```rust fn foo() { println!(\"foo\") } fn main() { ::foo() } ``` This produces the following error messages: ``` error[E0425]: cannot find function `foo` in the crate root --> src/main.rs:4:7 | 4 | ::foo() | ^^^ not found in the crate root help: possible candidate is | labels: A-diagnostics, A-resolve, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63800", "text": "rustc panic when trying to unwrap DistinctSources | When trying to compile the tests for my [code](https://github.com/software-opal/archivelib-rs/tree/compiler-bug-1.37) I get this error: ``` thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: DistinctSources(DistinctSources { begin: (Real(\"tests/macros.rs\"), | labels: I-ICE, A-macros, A-borrow-checker, T-compiler, A-NLL, C-bug", "label": "question", "label_id": 4} {"id": "rust_63802", "text": "ICE trying to compile libstd with -Zmir-opt-level=3 | ``` error: internal compiler error: src/librustc_mir/transform/inline.rs:677: Return place is (*_28), not local thread 'rustc' panicked at 'Box', src/librustc_errors/lib.rs:643:9 stack backtrace: 0: backtrace::backtrace::libunwind::trace at /cargo/registry/src/github.com-1ec | labels: I-ICE, T-compiler, A-MIR, C-bug, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_63816", "text": "RustDoc: remove the redundant unstable option \"--linker\" | while working on https://github.com/rust-lang/rust/issues/63638 i have noticed the there is a conflict between the \"-C linker\" and the \"--linker\" option where the later overrides the former. but as the `--linker` flag is unstable I think that it shall be removed as is it confusin | labels: C-cleanup, T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_63821", "text": "rustdoc crashes on nightly nightly-2019-08-22 | `cargo doc` crashes on nightly (`nightly-2019-08-22`) and also on stable (`1.37.0`) with \"nightly\" features turned on via `RUSTC_BOOSTRAP=1`. It does not trigger on stable without `RUSTC_BOOTSTRAP=1` flag. Here is the output I'm getting: ``` thread 'rustc' panicked at 'could not | labels: T-rustdoc, I-ICE, C-bug", "label": "high", "label_id": 1} {"id": "rust_63822", "text": "impl Display for Path | It's deliberate that to date Path does not impl Display. It's a conservative stance that says that because the conversion to utf8 can be lossy, there isn't necessarily one obviously correct way to display a path. I'd like to revisit that decision, in the interests of convenience. | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_63826", "text": "How to disable rust runtime stack_overflow check | Hi community, I was using [GEM5](http://gem5.org/Main_Page) architecture simulator to run Rust binaries. However, GEM5 simulator does support syscall sigaltstack, which is called by libstd/sys/unix/stack_overflow.rs further by libstd/rt.rs (sys::stack_overflow::init()). I was won | labels: T-libs-api, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_63828", "text": "Cross-compile of rust fails in 1.36.0 and 1.37.0 | I'm habitually doing cross-builds of the various rust NetBSD targets, in addition to the native amd64 target (cross-build host). The normal procedure I've followed and which works with 1.35.0, now fails in 1.36.0 and 1.37.0 inside the LLVM build with: ``` [ 1%] Building CXX objec | labels: A-LLVM, A-cross, O-netbsd, T-bootstrap, C-bug", "label": "question", "label_id": 4} {"id": "rust_63829", "text": "dli_saddr may be const | The various NetBSD ports declare `dli_saddr` as ``` const void *dli_saddr; /* Symbol address */ ``` This gives rise to the need for the following patch to avoid \"cast discards qualifier\" warnings, which might be (\"was\" in my case) configured to act as an error: ``` --- src/llvm-p", "label": "question", "label_id": 4} {"id": "rust_63830", "text": "Automatic dark theme doesn't work | Requested in #61079 and implemented in #61236, the automatic theme switching doesn't seem to do anything: If I visit while the system is in dark mode, I can see in the developer tools that the `` element has the style `content: \"dark | labels: T-rustdoc, C-bug", "label": "medium", "label_id": 2} {"id": "rust_63832", "text": "temporary lifetime around await is (maybe) unexpectedly short | So @sfackler pointed out something to me. The problem @sfackler reported was that temporary lifetimes around `await` were too short. The effect was that `foo(&[123]).await` would give an error where `foo(&[123])` would not (in sync code). My assumption was that this was caused by | labels: T-lang, T-compiler, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2} {"id": "rust_63835", "text": "message-format=short output is unnecessarily hard to read | The `--message-format=short` option is a very convenient way to get a condensed error output from cargo when the same/similar errors occur at many places in a code base. Unfortunately, the current output with this option uses bold/color to place the emphasis on the wrong parts of | labels: C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63837", "text": "rustc panic: Inner macro with loop-label inside closure. | https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3bc7b5bf33f55dbb70550fb8f4b6804c | labels: I-ICE, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_63838", "text": "struct containing array of size given in Self and slice causes compiler panic | A struct containing an array and a reference to a slice causes the compiler to panic if the array size is defined in the impl block. The issue also occurs for smaller array sizes. - Size in impl (panics): https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=6 | labels: I-ICE, A-associated-items, A-borrow-checker, T-compiler, A-NLL, C-bug", "label": "high", "label_id": 1} {"id": "rust_63840", "text": "Is the comment re. unstable-book in `src/libsyntax/feature_gate/active.rs` still relevant? | See https://github.com/rust-lang/rust/pull/63824#discussion_r316941434. The comment currently exists in `src/libsyntax/feature_gate.rs` but is being moved in the PR above to `src/libsyntax/feature_gate/active.rs`. cc @oli-obk | labels: I-needs-decision, T-lang, T-compiler, A-docs", "label": "question", "label_id": 4} {"id": "rust_63841", "text": "compiler | my english is not good , So let's say by example. let x = if {}{};//error:^ expected if condition here let x = if{()}{};//error : ^^ expected bool, found () let x = if{return ()}{}:its correct and condition evaluated to false.but i think -> error:^^ expected bool, found () if it ", "label": "medium", "label_id": 2} {"id": "rust_63842", "text": "`use foo::{self, ...}` doesn't import macro `foo!` | When there is a macro and a module with the same name, `use foo::{self, Bar}` syntax imports the module `foo`, but not the macro `foo!`. So you are forced to use this: ```rust use crate::foo; use crate::foo::Bar; ``` It is especially annoying because rustfmt automatically merges | labels: A-resolve, T-lang", "label": "medium", "label_id": 2} {"id": "rust_63843", "text": "`miri` no longer builds after rust-lang/rust#63637 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63637, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @alexcrichton, do you think you would ha | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_63844", "text": "Don't print expression result for dbg!() when expr is literal | ```rust fn main() { dbg!(\"Hello, world!\"); } ``` Should give: ``` [src/main.rs:2] \"Hello, world!\" ``` Instead of: ``` [src/main.rs:2] \"Hello, world!\" = \"Hello, world!\" ``` This should be possible by adding a macro rule matching `$val:literal` before the rule matching `$val:expr`.", "label": "medium", "label_id": 2} {"id": "rust_63848", "text": "rustc could not initialize thread_rng (on pre-getrandom Linux kernel) | nushell: https://book.nushell.sh/en/installation / no on-point issues seen here -- searched for \"nushell\" Tried to build nushell from source and it required \"nightly\" rust. Didn't know how to install that, so I used \"cargo install nu\" I expected to see | labels: O-linux, I-ICE, P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_63850", "text": "Lint for unused unstable feature gates | I've seen two codebases now that used to have unused feature gates: * https://github.com/libra/libra/commit/2f44be56a14492be236ec30925dec3d5e31342ad (this commit was in july while duration_float stabilized in August) * https://github.com/libra/libra/commit/e263fbdc1dd83305d9962d0 | labels: A-lints, A-stability, T-lang, C-feature-request", "label": "low", "label_id": 3} {"id": "rust_63852", "text": "Compile message contains reference to an identifier not used by the erraneous code | rustc 1.37.0 (eae3437df 2019-08-13) Repo: https://github.com/svenschmidt75/Rust Commit: https://github.com/svenschmidt75/Rust/commit/23ec34211661c8f77c040b751500c86157f01305 When building, I get error message ``` Compiling ann v0.1.0 (/home/svenschmidt75/Develop/Rust/NeuralNetwor | labels: C-enhancement, A-diagnostics, T-compiler, A-inference", "label": "low", "label_id": 3} {"id": "rust_63857", "text": "Impl HasDataLayout and HasTargetSpec for T where T: HasTyCtxt | labels: E-easy, C-enhancement, T-compiler", "label": "low", "label_id": 3} {"id": "rust_63866", "text": "Niche-filling layouts are picked over tagged ones even when detrimental. | This prints the values in comments: ```rust use std::num::NonZeroU8; pub enum Foo { A(NonZeroU8, u32), B } pub enum Bar { A(u8, u32), B } fn main() { use std::mem::size_of; dbg!(size_of::()); // = 8 dbg!(size_of::>()); // = 12 dbg!(size_of::>>( | labels: I-slow, C-enhancement, T-compiler, A-layout", "label": "low", "label_id": 3} {"id": "rust_63868", "text": "Subpar error when lifetime checking for `dyn Trait` evaluates to `'static` | ``` fn foo(x: &Vec) -> Box> { Box::new(x.iter()) } fn main() { let x: Vec = vec![1, 2, 3]; let _ = foo(&x); } ``` the `rustc` output is ``` error[E0495]: cannot infer an appropriate lifetime for lifetime parameter in function call due to conflic | labels: C-enhancement, A-diagnostics, A-lifetimes, T-compiler, A-NLL, NLL-diagnostics", "label": "low", "label_id": 3} {"id": "rust_63876", "text": "ICE trying to run cargo clippy on hello world lib.rs | I just tried running `cargo clippy` on the exercism rust track hello world (https://exercism.io) I tried this code: Here are the contents of the folder I'm trying to run it on: https://github.com/nico-abram/rust_test_exercism I expected to see this happen: Clippy. Instead, this h | labels: I-ICE, T-compiler, T-cargo, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_63879", "text": "Add missing code examples on Iterator trait | labels: C-enhancement, A-docs, A-iterators", "label": "low", "label_id": 3} {"id": "rust_63881", "text": "rust build/compile on solaris 11.4 | Hi Team, we are not able to compile rust source on solaris 11.4. Can you please share correct documentation/steps/source/binary..etc for solaris 11.4. Thanks in advance!! Regards, Gopalakrishnan", "label": "medium", "label_id": 2} {"id": "rust_63882", "text": "Raw identifier keywords are sometimes silently accepted in paths | Example: ```rust type A = crate::r#break; // No error (?!) fn main() {} ``` Found by crater run (https://crater-reports.s3.amazonaws.com/beta-1.38-1/beta-2019-08-13/gh/xi-frontend.xi-term/log.txt) when visibility resolution switched to a different algorithm (early resolution), wh | labels: A-resolve, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_63883", "text": "#[unwind(aborts)] does nothing on `extern \"Rust\" fn` | I would expect the following code to abort, and never print `Hello`: ```rust #![feature(unwind_attributes)] #[unwind(aborts)] fn foo() { // implicitly: extern \"Rust\" panic!(\"foooo\"); } fn main() { if let Err(_) = std::panic::catch_unwind(|| foo()) {} println!(\"Hello\"); } ``` But | labels: T-compiler, C-bug, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_63885", "text": "[1.38] Regression: failed to resolve: could not find `rustc_serialize` in `{{root}}` | https://github.com/rust-lang/rust/issues/63628#issuecomment-524585041 Caused by https://github.com/rust-lang/rust/pull/63449. Tests in `rustc-serialize` and its fork `rustc-serialize2` are broken, no other crates are affected. (Can be fixed with `extern crate self as rustc_seriva | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63886", "text": "[1.38] Regression: lifetime name `'s` declared twice in the same scope | https://github.com/rust-lang/rust/issues/63628#issuecomment-524585351 >lifetime name `'s` declared twice in the same scope >lifetime name `'input` declared twice in the same scope ``` ./reg/cff/0.5.0/beta-2019-08-13.txt:[INFO] [stderr] error[E0263]: lifetime name `'s` declared tw | labels: T-lang, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63887", "text": "[1.38] Regression: attributes starting with `rustc` are reserved for use by the `rustc` compiler | https://github.com/rust-lang/rust/issues/63628#issuecomment-524586506 >attributes starting with `rustc` are reserved for use by the `rustc` compiler ``` ./reg/select-rustc/0.1.2/beta-2019-08-13.txt:[INFO] [stdout] error[E0658]: attributes starting with `rustc` are reserved for us | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63888", "text": "[1.38] Regression: cannot find macro `trace!` in this scope | https://github.com/rust-lang/rust/issues/63628#issuecomment-524587231 >cannot find macro `trace!` in this scope >cannot find macro `flatdata_intersperse!` in this scope ``` ./reg/eztrace/0.1.0/beta-2019-08-13.txt:[INFO] [stderr] error: cannot find macro `trace!` in this scope ./r | labels: P-high, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63889", "text": "[1.38] Regression: expected open delimiter | https://github.com/rust-lang/rust/issues/63628#issuecomment-524587696 >expected open delimiter ``` ./reg/dtolnay/0.0.2/beta-2019-08-13.txt:[INFO] [stderr] error: expected open delimiter ``` Expected breakage of an unstable feature (`my_macro! name { ... }` no longer parses), caus | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63890", "text": "[1.38] Regression: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `is` | https://github.com/rust-lang/rust/issues/63628#issuecomment-524590824 >expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `is` ``` ./reg/google-games1/1.0.10+20190627/beta-2019-08-13.txt:[INFO] [stdout] error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, | labels: T-rustdoc, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63891", "text": "[1.38] Regression: expected module, found unresolved item `crate::mod` | https://github.com/rust-lang/rust/issues/63628#issuecomment-524633353 >expected module, found unresolved item `crate::mod` ``` ./gh/xi-frontend/xi-term/beta-2019-08-13.txt:[INFO] [stderr] error[E0577]: expected module, found unresolved item `crate::mod` ``` This is the most hilar | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63892", "text": "[1.38] Regression: failed to resolve: use of undeclared type or module `SliceConcatExt` | https://github.com/rust-lang/rust/issues/63628#issuecomment-524634090 >failed to resolve: use of undeclared type or module `SliceConcatExt` ``` ./gh/echupriyanov/tls-ws/beta-2019-08-13.txt:[INFO] [stderr] error[E0433]: failed to resolve: use of undeclared type or module `SliceCon | labels: T-libs-api, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63893", "text": "[1.38] Regression: cannot determine resolution for the derive macro `Debug` | https://github.com/rust-lang/rust/issues/63628#issuecomment-524636403 >cannot determine resolution for the derive macro `Debug` ``` ./reg/ruroonga_command/0.3.4/beta-2019-08-13.txt:[INFO] [stderr] error: cannot determine resolution for the derive macro `Debug` ``` Minimized: ```r | labels: T-lang, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63894", "text": "[1.38] Regression: proc macro panicked | https://github.com/rust-lang/rust/issues/63628#issuecomment-524641105 >proc macro panicked ``` [INFO] [stderr] Compiling custom-slice-macros v0.1.1 (/opt/crater/workdir) [INFO] [stderr] error: proc macro panicked [INFO] [stderr] --> tests/derives.rs:48:13 [INFO] [stderr] | [INFO] | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63895", "text": "[1.38] Regression: custom attribute panicked | https://github.com/rust-lang/rust/issues/63628#issuecomment-524641889 >custom attribute panicked ``` [INFO] [stderr] Compiling display-as v0.4.6 (/opt/crater/workdir) [INFO] [stderr] error: custom attribute panicked [INFO] [stderr] --> tests/format_as.rs:104:5 [INFO] [stderr] | [ | labels: T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63896", "text": "[1.38] Regression: proc-macro derive panicked | https://github.com/rust-lang/rust/issues/63628#issuecomment-524643597 >proc-macro derive panicked ``` [INFO] [stderr] error: proc-macro derive panicked [INFO] [stderr] --> src/lib.rs:11:1 [INFO] [stderr] | [INFO] [stderr] 11 | / proc_macro_item_decl! { [INFO] [stderr] 12 | | /// | labels: A-pretty, A-macros, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_63898", "text": "Rust Installer: OS Error 649: The create operation failed because the name contained at ... | I got the below information when installing the rustup-init.exe

 error: component download failed for rustc-x86_64-pc-windows-msvc info: caused by: could not rename downloaded file from 'C:\\Users\\Hadi\\.rustup\\downloads\\923e829d67102e45fc16eeae727a4dad13f7abe6239b99fef0e4a233", "label": "medium", "label_id": 2}
{"id": "rust_63900", "text": "ICE having include! in code from stdin when calling rustc | to reproduce the fault this can be used: `echo 'include!(\"auxiliary/empty.rs\"); pub fn main(){}' | rustc - ` will result in this ICE: `thread 'rustc' panicked at 'cannot resolve relative path in non-file source ', src/libsyntax/ext/source_util.rs:189:22 note: Run with RUST_BACKTR | labels: I-ICE, I-needs-decision, T-lang, C-bug, glacier", "label": "question", "label_id": 4}
{"id": "rust_63904", "text": "Collect occurrences of `{}` for mismatched braces diagnostic | Many editors _helpfully_ auto close delimiters when writing them down. It is not uncommon for this to cause the following to occur: ``` fn main() {} let _ = (); } ``` It'd be a good idea for the parser or lexer to keep track of these empty blocks to provide an error closer to ``` | labels: E-easy, C-enhancement, A-diagnostics, A-parser, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3}
{"id": "rust_63905", "text": "No documentation about f32_runtime without std | Hi, It seems like all the functions under `f32_runtime` don't work without std (https://doc.rust-lang.org/src/std/f32.rs.html#29-994) I tried looking for documentation about this and didn't find anything concrete, and since the `core` docs don't have documentation for the primiti | labels: C-enhancement, T-libs-api, A-docs, A-floating-point", "label": "low", "label_id": 3}
{"id": "rust_63908", "text": "Cannot convert this tail recursive function into an iterative one due to lifetime error | Rust version: 1.37.0 This problem has been previously discussed on [Stack Overflow](https://stackoverflow.com/q/57643908/722720) and [Rust Users Forum](https://users.rust-lang.org/t/how-do-you-remove-the-last-node-from-a-singly-linked-list/31805?u=efanzh). And I think it is somet | labels: C-enhancement, A-borrow-checker, NLL-polonius", "label": "low", "label_id": 3}
{"id": "rust_63910", "text": "linking with `cc` failed: exit code: 1 | error: linking with `cc` failed: exit code: 1 | = note: \"cc\" \"-Wl,--as-needed\" \"-Wl,-z,noexecstack\" \"-m64\" \"-L\" \"/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib\" \"/opt/rust/target/debug/build/log-2c3a5c1cf08eb014/build_script_buil", "label": "medium", "label_id": 2}
{"id": "rust_63911", "text": "1.38 beta fails to bootstrap itself | When using 1.38 beta to bootstrap itself, I get: ``` error: unnecessary `unsafe` block --> src/bootstrap/builder.rs:148:19 | 148 | name: unsafe { ::std::intrinsics::type_name::() }, | ^^^^^^ unnecessary `unsafe` block | ``` | labels: T-bootstrap", "label": "medium", "label_id": 2}
{"id": "rust_63912", "text": "rustc should error instead of panic when the generator trait is not found | This somehow doesn't occur when putting the `abc` function in a non `#![no_core]` crate, yet I can't find any difference between the `libcore` version of `FnOnce` and this one. ```rust #![feature(no_core, lang_items, unboxed_closures)] #![no_core] #[lang = \"sized\"] pub trait Size | labels: E-easy, I-ICE, T-compiler, E-help-wanted, C-bug, A-coroutines", "label": "high", "label_id": 1}
{"id": "rust_63913", "text": "`miri` no longer builds after rust-lang/rust#63580 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63580, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @wesleywiser, do you think you would have | labels: T-compiler", "label": "medium", "label_id": 2}
{"id": "rust_63915", "text": "Default sysconfdir | I'm not sure this is actually a bug but it seems like it could be. The default sysconfdir in config.toml is `/etc`; which means it bypasses the user-defined prefix, in turn resulting in the installation failing if not running as root (even when installing to a user folder or, as  | labels: C-enhancement, P-low, T-bootstrap", "label": "low", "label_id": 3}
{"id": "rust_63916", "text": "Const function sized arrays fail to evaluate `Sized` bound | Hello, I was trying to have generic arrays that occupy as much of a single cache line as possible, but get a compile error when trying to use `std::mem::size_of()`, as the `T: Sized` constraint seems to be evaluated later than [T; N] seems to require the value. Is this behavio | labels: A-trait-system, T-compiler, C-bug, A-const-eval", "label": "medium", "label_id": 2}
{"id": "rust_63918", "text": "Wasm code failing regression probably related to update to LLVM 9 trunk | # Summary: The following piece of code fail when compiled to wasm32-unknown-unknown since nightly-2019-07-18. This nightly introduces https://github.com/rust-lang/rust/pull/62592/files so probably related. # Regression test: ```rust pub fn get() -> u128 { let d = [0, 0, 32, 59, 1 | labels: A-LLVM, P-medium, T-compiler, regression-from-stable-to-beta, I-unsound, O-wasm", "label": "critical_bug", "label_id": 0}
{"id": "rust_63924", "text": "Migrate test suite to use run-pass stdout/stderr testing | Where possible, we should prefer to use the functionality added by https://github.com/rust-lang/rust/pull/63825 instead of `std::process` and the like. At least one such test is known, but it's possible more can be found. | labels: E-easy, C-cleanup, A-testsuite, E-mentor", "label": "low", "label_id": 3}
{"id": "rust_63925", "text": "Building a no_std cdylib results in \"syntax error in VERSION script\" | I'm trying to build a pure `no_std` `cdylib` with no external library dependencies. For an initial proof of concept, I tried to create such a library using the following code: ```Cargo.toml```: ```toml [package] name = \"cdylib-no-std\" version = \"0.1.0\" edition = \"2018\" [lib] crat | labels: A-linkage, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_63928", "text": "./x.py build --help gives misleading help | ``` $ ./x.py build --help [...] For a quick build of a usable compiler, you can pass: ./x.py build --stage 1 src/libtest ``` But in practice: ``` $ ./x.py build --stage 1 src/libtest Updating only changed submodules Submodules updated in 0.13 seconds Finished dev [unoptimized] ta | labels: E-easy, E-mentor, T-bootstrap, C-bug", "label": "low", "label_id": 3}
{"id": "rust_63932", "text": "ICE on borrow check `check_loans` on stable | I don't know how to minimize this... ``` $ RUST_BACKTRACE=1 cargo run Compiling baguetteland v0.1.0 (/nobackup/baguetteland) thread 'rustc' panicked at 'assertion failed: self.bccx.region_scope_tree.scopes_intersect(old_loan.kill_scope, new_loan.kill_scope)', src/librustc_borrowc | labels: I-ICE, A-borrow-checker, T-compiler, C-bug", "label": "high", "label_id": 1}
{"id": "rust_63935", "text": "Intra-rustdoc Links Do Not Work For Anything | ## Stats: toolchain version: stable-x86_64-unknown-linux-gnu (default) rustc version: rustc 1.37.0 (eae3437df 2019-08-13) cargo version: cargo 1.37.0 (9edd08916 2019-08-02) ## Steps to reproduce: 1. Run `cargo init example` 2. Edit `example/src/main.rs` 3. At the top, add `//! Ch", "label": "medium", "label_id": 2}
{"id": "rust_63939", "text": "error: failed to run custom build command for `ring v0.14.6` | error: build failed [root@eulerOS:/opt/rust]# RUST_BACKTRACE=1 cargo build --target x86_64-unknown-linux-musl Compiling ring v0.14.6 Compiling num-traits v0.2.8 Compiling atty v0.2.13 Compiling rand v0.4.6 Compiling base64 v0.10.1 Compiling want v0.2.0 Compiling tokio-resource-po", "label": "medium", "label_id": 2}
{"id": "rust_63942", "text": "Better error message for 'is private' | ``` mod foo { use bar::A; mod bar { pub struct A {} } } use foo::A; fn main() {} ``` Produces the error: ``` error[E0603]: struct `A` is private --> src/main.rs:9:10 | 9 | use foo::A; | ^ ``` [playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gis | labels: C-enhancement, A-diagnostics, A-visibility, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3}
{"id": "rust_63943", "text": "Undefined Behavior in safe code that unwinds out of `extern \"C\"` function | **UPDATE**: this optimization is perfectly correct. It only breaks code that already has undefined behavior. This is however an issue since until #52652 is fixed we want to keep such code working. **ORIGINAL TITLE**: mis-compilation of noreturn extern \"C\" definitions that unwind  | labels: A-FFI, T-lang, I-unsound, C-bug", "label": "critical_bug", "label_id": 0}
{"id": "rust_63946", "text": "`Ref` methods unnecessary? | I'm a bit confused about the methods on `std::cell::Ref`. Are there any use cases for the `clone`, `map`, and `map_split` methods? I understand the value for `RefMut` (since there can only be one mutable borrow, you can change what it points to split one borrow into multiple refe", "label": "question", "label_id": 4}
{"id": "rust_63947", "text": "Excess semicolon lint produces wrong diagnostics with async main and derive macro | The new lint for excess semicolons (https://github.com/rust-lang/rust/pull/62984) has some weird behaviour when the lint is triggered inside an async function that is transformed using a procedural macro. Rustc version: 1.39.0-nightly (9b91b9c10 2019-08-26) Compiling this: ```rus | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_63952", "text": "rustc diverges on large dangling integer slice | I wanted to test our handling of slices that are \"too big\" (bigger than the largest possible allocation), so I wrote: ```rust use std::usize; #[repr(C)] #[derive(Copy, Clone)] struct SliceRepr { ptr: *const u8, len: usize, } union SliceTransmute { repr: SliceRepr, slice: &'static | labels: E-needs-test, A-const-eval", "label": "medium", "label_id": 2}
{"id": "rust_63954", "text": "Add optional span to `require_lang_item` for diagnostics with more context | [`fn require_lang_item(LangItem)`](https://github.com/rust-lang/rust/blob/615c46086a994f088c9ed569fc36df229ae115b6/src/librustc/middle/lang_items.rs#L384-L388) should also take an optional `Span` to [avoid output without context](https://github.com/rust-lang/rust/pull/63917/files | labels: E-easy, C-enhancement, A-diagnostics, T-compiler, A-lang-item", "label": "low", "label_id": 3}
{"id": "rust_63959", "text": "Miscompilation with target-cpu=znver1 (AMD Ryzen 1000/2000 series) on Windows + LLVM 9. | On any recent MSVC nightly, compiling with `release` profile with `RUSTFLAGS = \"-C target-cpu=native\"` results in either `STATUS_ACCESS_VIOLATION` or `STATUS_HEAP_CORRUPTION` depending on the crate. Many crates work, but others don't. Among those that fail some use SIMD. `target- | labels: I-crash, A-LLVM, P-high, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0}
{"id": "rust_63962", "text": "Hint on missing tuple parens in pattern | It'd be nice to smartly hint about missing tuple parentheses in patterns, especially in positions where parentheses nesting is required. Example of incorrect code: ```rust fn main() { match Some((1, 2)) { Some(x, y) => {} None => {} } } ``` The error: ```rust error[E0023]: this p | labels: C-enhancement, A-diagnostics, E-mentor, T-compiler, E-help-wanted, E-medium", "label": "low", "label_id": 3}
{"id": "rust_63964", "text": "Bootstrap fails to build in not completely clean environment | * `git checkout 53df91a9b24ad999e7ca896447af6f5f74fe43bc` (today's master) * `make prepare` ``` [...] Compiling bootstrap v0.0.0 (/home/jethro/projects/rust/src/bootstrap) Finished dev [unoptimized] target(s) in 7.16s ``` (success) * `git checkout 72bfc375356b56933955e07471f91ef9 | labels: T-bootstrap, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_63966", "text": "Call pinned method from Trait on generic parameter | I've found a problem regarding [Pin](https://doc.rust-lang.org/nightly/std/pin/struct.Pin.html) that I just can't solve and the current Nightly compiler gives a misleading suggestion. [This playground example serves well as a minimalist example](https://play.rust-lang.org/?versio | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2}
{"id": "rust_63967", "text": "redundant_semicolon and clippy::no_effect tripped without emitting line numbers | Using nightly-2019-08-26. In [this TiKV PR](https://github.com/tikv/tikv/pull/5261#issuecomment-525569617) we upgraded the compiler. Our tidb_query component tripped the redundant_semicolon lint (and seemingly in turn clippy::no_effect) but rustc/clippy did not tell us the line n | labels: A-lints, A-diagnostics, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "question", "label_id": 4}
{"id": "rust_63972", "text": "E0425 suggestion has `fn` keyword before `use ...;` | ```shell $ rustc --version rustc 1.39.0-nightly (4cf767307 2019-08-18) $ cargo --version cargo 1.38.0-nightly (e853aa976 2019-08-09) $ cat rust-toolchain nightly-2019-08-19 ``` ```rust #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FileId(pub usize | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2}
{"id": "rust_63974", "text": "Confusing error message on private newtype field | ``` $ rustc --version rustc 1.37.0 (eae3437df 2019-08-13) ``` To reproduce: ``` [dependencies] actix-web = \"1.0.5\" ``` ``` use actix_web::web; fn main() { let a: web::Query = web::Query(4); } ``` `Query` is defined as: `pub struct Query(T);` Yet, the error message: ``` er | labels: A-diagnostics, A-visibility, T-compiler, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2}
{"id": "rust_63976", "text": "Incorrect error message when accessing private field of union | ```rust #[derive(Copy, Clone)] pub struct B; mod a { pub union U { pub a: i32, b: crate::B, } } fn new(a: i32) -> B { unsafe { a::U { a }.b } } ``` ([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d461d59d40a77187aa1f38e1861f0801)) Errors: `` | labels: E-easy, A-diagnostics, A-visibility, T-compiler, C-bug", "label": "low", "label_id": 3}
{"id": "rust_63977", "text": "Weird segfault when trying inline asm on macOS in Rust | Hello! I tried this piece of code: ```Rust #![feature(asm)] fn main() { unsafe { asm!(\" xor rax, rax .process_loop: nop add rax, 1 cmp rax, 500 jne .process_loop \": : :\"rax\" :\"intel\") }; } ``` On windows it compiles and runs normally. On my macOS it compiles with no error or warn | labels: O-macos, A-inline-assembly, T-compiler, requires-nightly", "label": "medium", "label_id": 2}
{"id": "rust_63978", "text": "Reducing the memory/bandwidth footprint of submodules with ./x.py? | I recently tried to compile rust by using the `./x.py` script. I noticed that the first thing that happens is a full clone of all the git submodules (see https://github.com/rust-lang/rust/blob/master/src/bootstrap/bootstrap.py#L679-L687). Cloning the whole history of all the subm | labels: C-enhancement, T-bootstrap", "label": "question", "label_id": 4}
{"id": "rust_63981", "text": "Self::fn_name returns non-static fn item | It's hard to describe, but this fails to compile [playground](https://play.rust-lang.org/?gist=b8ea20af2f92d025b0fa2176346a971e): ```rust trait Foo { fn bar() { Self::bar.type_id(); // Any::type_id, Any requires 'static } } ``` Error: ``` error[E0310]: the parameter type `Self` m | labels: A-lifetimes, A-trait-system, T-lang, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_63983", "text": "Unify errors for Unit pattern on Tuple and Struct variants | Code Example ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=73d19f6e2a08205bb03e3741d6588de5)): ``` enum MyEnum { Tuple(i32), Struct { s: i32 }, } fn foo(en: MyEnum) { match en { MyEnum::Tuple => \"\", MyEnum::Struct => \"\", }; } ```  src/librustc_mir/hair/pattern/_match.rs:1614:53 | 1611 | if let Some(range) = x { | ----- value moved here ... 1614 | debug!(\"intersection {:?}\", x); | ^ value borrowed here after partial move | = note: move oc | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics, D-papercut, D-newcomer-roadblock", "label": "low", "label_id": 3}
{"id": "rust_64002", "text": "Misleading error messages about lifetimes and borrowing | The error message is misleading that it led me to another approach through which I can't fix my program. ```log error[E0597]: `line` does not live long enough --> src/main.rs:24:30 | 24 | let spt: Vec<&str> = line.split(char::is_whitespace).collect(); | ^^^^ borrowed value does n | labels: A-diagnostics, A-lifetimes", "label": "medium", "label_id": 2}
{"id": "rust_64004", "text": "async-await: mutually recursive functions compile sometimes | In the following code: ```rust async fn rec_1() { rec_2().await; } async fn rec_2() { rec_1().await; } ``` This gives an error when it is a part of a `lib` crate. However, as a part of a `bin` crate, it compiles. Here's an [erroneously compiling playground link](https://play.rust | labels: A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2}
{"id": "rust_64006", "text": "Dependencies with build script fail on FreeBSD + 1.39 nightly | Tested on various crates like bindgen, backtrace, async-std, etc, that has one or more -sys dependencies that include a build.rs file. All such deps fail with errors like: ``` error: failed to run custom build command for `openssl-sys v0.9.49` Caused by: process didn't exit succe | labels: P-medium, regression-from-stable-to-nightly, T-compiler, O-freebsd, C-bug", "label": "critical_bug", "label_id": 0}
{"id": "rust_64009", "text": "Why can't update libc to 0.2.63 or 0.2.64? | I notice by default we are using libc 0.2.61. and we can update it to 0.2.62 if using \"cargo update -p libc\". But I see the latest libc version is 0.2.64. Is there any special reason that prevent us from using the version 0.2.63 or version 0.2.64? Thanks, Baoshan", "label": "medium", "label_id": 2}
{"id": "rust_64013", "text": "Segfaults on FreeBSD in some cases since 1.37.0 | I have a crate that links to library in base for FreeBSD, up until 1.37 it was working fine. Since 1.37 and after it started segfaulting on certain calls. I can't reproduce it outside of FreeBSD, but here is is the \"minimal\" [example](https://github.com/Inner-Heaven/libnv-rs/blob", "label": "question", "label_id": 4}
{"id": "rust_64020", "text": "`miri` no longer builds after rust-lang/rust#63402 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63402, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @estebank, do you think you would have t | labels: T-compiler", "label": "medium", "label_id": 2}
{"id": "rust_64022", "text": "Tracking issue for making `Vec::new` a `const fn` | This tracks stabilization of the `const_vec_new` feature, introduced in https://github.com/rust-lang/rust/pull/50233, which allows calling `Vec::new` in a constant expression. | labels: A-collections, T-lang, T-libs-api, B-unstable, C-tracking-issue, A-const-eval", "label": "medium", "label_id": 2}
{"id": "rust_64024", "text": "Matches on tuples of boxes present incorrect dereference help text | Consider the following broken code([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f9637cf1265ffb17eeac765c000ba345)): ```rust struct S(i32); fn main() { let x = Box::new(S(1)); let y = Box::new(S(2)); let f = match (x, y) { (S(a), S(b)) => (a | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2}
{"id": "rust_64027", "text": "RangeBounds impl for Range*<&T> is missing ?Sized | Much like the impl for `(Bounds<&T>, Bounds<&T>)`, `impl RangeBounds for RangeFrom<&T> {` could use a `T: ?Sized`. This would allow ```rust let map = BTreeMap::::new() map.range::(\"a\"..); ``` to compile the way it does when using Bound. (Unfortunately I | labels: E-mentor, T-libs-api, C-feature-request", "label": "medium", "label_id": 2}
{"id": "rust_64033", "text": "Help with enum of Box through FFI | Hello everyone! I am having an issue understanding how to share an Enum, where some variants holds a Box, through FFI boundary. The Enum looks like this: ```Rust #[derive(Debug)] #[repr(C)] pub enum SchemeType { Ip, Bytes, Int, Bool, Array(Box), Map(Box), ", "label": "question", "label_id": 4}
{"id": "rust_64034", "text": "C++ compiler cache causes compiler segfaults on ARM | Since the LLVM 9 update, rustc will segfault on ARM hosts with opt-level > 0 and codegen-units > 1. The possible cause is that GCC ARM C++ ABI is not very stable (sometimes you will see the \"parameter passing of argument of type ... changed in GCC \\\" note) and sccache d", "label": "medium", "label_id": 2}
{"id": "rust_64037", "text": "Incorrect unused warning when value is used for a comparison inside a function invocation | The following code generates an unused variable warning for x: ``` fn test(v: bool) { println!(\"value is {}\", v); } fn main() { let mut x: Option = None; x = Some(5); test(x.unwrap() == 5); } ``` ``` --> test.rs:6:11 | 6 | let mut x: Option = None; | ^ | = note: `#[warn", "label": "medium", "label_id": 2}
{"id": "rust_64045", "text": "Incorrect error reported for doc comment on if statement | Example code ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3391ce9f657a47424a118ad9a6941a99)): ```rust fn main() { /// Accidental doc comment if true { } } ``` Error: \"image\"() -> [T; TO] { panic!(); } fn uperms() -> Vec<[u8; DICE_NUM]> { if DICE_NUM <= 1 { return vec![mk_array::()]; } else { let pperms = uperms::<{ DICE_NUM - 1 }>(); panic!(); }", "label": "high", "label_id": 1}
{"id": "rust_64050", "text": "debuginfo/boxed-struct test fails with LLDB 8 | On a fresh clone (b3146549ab) of the `rust` repro, using LLVM/clang/lldb 8.0.0, the `debuginfo/boxed-struct` test fails due to #47938. As noted in my [comment there](https://github.com/rust-lang/rust/issues/47938#issuecomment-526878164), the cause is the local variable `unique` s", "label": "question", "label_id": 4}
{"id": "rust_64055", "text": "vec![] creates broken vector of tuples with nulls in memory if a lot of elements passed. | **Description:** for example I can create vector with over 50K elements, using vec![/* elements */]; When I iterate values in vector I can meet that my tuple value is null (0), and next values will be null too. I tried same with array, &[(i64, i64, i64)].to_vec(), but it's workin | labels: T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64059", "text": "`-(-0.0)` raises const_err \"attempt to negate with overflow\" | ```rust fn main() { let _ = -(-0.0); } ``` ``` error: this expression will panic at runtime --> test.rs:2:13 | 2 | let _ = -(-0.0); | ^^^^^^^ attempt to negate with overflow | = note: `#[deny(const_err)]` on by default error: aborting due to previous error ``` 
M | labels: E-easy, A-lints, E-mentor, T-compiler, C-bug, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_64061", "text": "Automatic dark theme still doesn't work | Follow-up to #61079, #61236, #63830, and #63847. Same symptoms as #63830. Additionally, I'm seeing styles from both light.css and dark.css active, and the ones in light.css are taking precedence over the ones in dark.css even though the system is in dark mode. Tested on test.rs:2:10 | 2 | for &(mut _x) in &", "label": "medium", "label_id": 2} {"id": "rust_64068", "text": "Diagnostics for an immutable reference to an iterator | This problem comes up in generic contexts, but the simplest code to reproduce is: ```rust let iter = &[1,2,3].iter(); for i in iter { } ``` Results in: > error[E0277]: `&std::slice::Iter<'_, {integer}>` is not an iterator > ```text > | for i in iter { > | ^^^^ `&std::slice::Iter< | labels: C-enhancement, A-diagnostics, T-compiler, A-iterators, A-suggestion-diagnostics, D-newcomer-roadblock", "label": "low", "label_id": 3} {"id": "rust_64070", "text": "Tracking issue for cstring_from_vec_of_nonzerou8 | Tracking issue for `impl From> for CString`. Code added in #64069", "label": "medium", "label_id": 2} {"id": "rust_64073", "text": "Confusing documentation on mem::transmute | [Documentation on mem::transmute](https://doc.rust-lang.org/std/mem/fn.transmute.html#alternatives) presents the following piece of code: ```rust let store = [0, 1, 2, 3]; let mut v_orig = store.iter().collect::>(); // Using transmute: this is Undefined Behavior, and a | labels: A-docs", "label": "low", "label_id": 3} {"id": "rust_64074", "text": "debuginfo/issue22656 test assertion fails with LLDB 8 | ## Problem The test `debuginfo/issue-22656` has the following failing assertion: ``` // lldbg-check:[...]$1 = StructWithZeroSizedField { x: ZeroSizedStruct, y: 123, z: ZeroSizedStruct, w: 456 } ``` Note the `g`, so this is for an LLDB that is _not_ rust-enabled. Here's what I see | labels: A-testsuite, A-debuginfo, C-bug", "label": "question", "label_id": 4} {"id": "rust_64077", "text": "Types cannot refer to persistent data from generic elements | This is a pseudo-code of a part of my library, it has not been compiled, because types, for some reason not clear to me, cannot refer to persistent data from generalized elements. ``` rustc 1.39.0-nightly (4295eea90 2019-08-30) ``` ```rust trait CheckErr { const U: usize = 0; typ", "label": "medium", "label_id": 2} {"id": "rust_64079", "text": "Paths involving 'super' don't work from within a function | The following code compiles correctly: ```rust struct Foo; mod inner { use super::Foo; } ``` However, when wrapped in a function: ```rust fn outer() { struct Foo; mod inner { use super::Foo; } } ``` it gives the following error: ``` error[E0432]: unresolved import `super::Foo` -- | labels: A-resolve, T-lang, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64081", "text": "[rustdoc] Convert double-hyphen to dash in docs | It would be nice to get rustdoc to convert double-hyphen (`--`) (probably just when surrounded by spaces?) to a dash character (`–`) in doc-comments. People tend to use double-hyphen in code instead of the actual actual character, since it's easier to type on most keyboards. I re | labels: T-rustdoc, C-feature-request, A-markdown-parsing", "label": "low", "label_id": 3} {"id": "rust_64084", "text": "cargo test gives up compiling after one error | I'm making a big refactor. When attempting to clean up my tests, `cargo test` appears to go file by file, alphabetically when compiling the tests. As soon as one `#[test]` has a compile error, the build is aborted. - `#[test]`s following the failure do not get compiled. - Subsequ | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64086", "text": "UnwindSafe and RefUnwindSafe should be in libcore | I *think* that would be useful to allow pure no_std libraries to implement those traits without needing the `std` cargo feature. cc @gnzlbg, you've asked about this #40628. | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64087", "text": "ICE when `into_iter()` is called on a const generic array of type T where size is unkown. | ~~Might be similar to #60744, idk.~~ This causes an ICE: ```rust #![feature(const_generics)] fn combinator() -> [T; S] {} fn main() { combinator().into_iter(); } ``` Backtrace: https://gist.github.com/ZeGentzy/d8a1eaa26fe3551e0c5590885265884a So does this: ```r | labels: I-ICE, A-incr-comp, A-const-generics, requires-nightly, F-const_generics", "label": "high", "label_id": 1} {"id": "rust_64088", "text": "Spurious `unsized` error on resolution error | the `bar` function does not exist, so its return type is implicitly inferred to be whatever type is consumed further down. If the inferred type is unsized, we may get additional errors though. I think we should find a way to silence that additional error. ```rust fn foo() { let x | labels: A-diagnostics, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64089", "text": "Add warnig for assignment to temporary | For simple useless code: ``` fn main() { const N: (usize, usize) = (10, 20); N.0 = 0; println!(\"{:?}\", N); } ``` rust compiller no any warnings/errors. But clippy have an one display item: ``` warning: assignment to temporary --> src/main.rs:3:5 | 3 | N.0 = 0; | ^^^^^^^ | ``` I t", "label": "medium", "label_id": 2} {"id": "rust_64090", "text": "Missed-optimization: extern \"C\" fn type calls are not nounwind | See https://rust.godbolt.org/z/9UvEyu ```rust #![feature(unwind_attributes)] extern \"C\" { #[unwind(allow)] fn foo(); // fn bar(); static bar: extern \"C\" fn(); static mut BAR: i32; } struct Foo; impl Drop for Foo { fn drop(&mut self) { unsafe { BAR = 42; } } } pub unsafe fn unwind | labels: A-LLVM, I-slow, A-FFI, T-lang, T-compiler, C-optimization", "label": "medium", "label_id": 2} {"id": "rust_64091", "text": "trait impl specialization does not support types out of constraints | As this [example](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e06032f3d222d3a15d84521356955782) ```rust #![feature(specialization)] trait A { fn a(); } default impl A for T { fn a() {} } impl A for i32 { fn a() {} } impl A for () { fn a(", "label": "question", "label_id": 4} {"id": "rust_64093", "text": "Inconsistent analysis results for unsafe blocks and operators | related: https://github.com/rust-lang/rustfmt/issues/3770 rust playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ef4769175cb5b4febb445b05c1e27b82 The second !unsafe block return &&bool. I think the second block should return bool. ```rust f", "label": "medium", "label_id": 2} {"id": "rust_64101", "text": "Improve `rustc::hir::PatKind::Wild` | The [`slice_patterns` feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/slice-patterns.html) introduces the `..` wildcard. It seems classified as `rustc::hir::PatKind::Wild` along with `_`. However, `Wild` currently has no information to distinguish betwe | labels: C-enhancement, T-compiler, A-HIR", "label": "low", "label_id": 3} {"id": "rust_64102", "text": "Tracking issue for `std::hint::black_box` | This is a tracking issue for the RFC `std::hint:_black_box`. Original RFC: [RFC 2360](https://rust-lang.github.io/rfcs/2360-bench-black-box.html) **Public API:** ```rust // std::hint pub fn black_box(dummy: T) -> T; ``` **Steps:** - [x] Implementation - [x] FCP - [ ] Stabiliza | labels: B-RFC-approved, T-libs-api, T-compiler, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "question", "label_id": 4} {"id": "rust_64103", "text": "false positive \"unreachable expression\" | ````rust pub fn main() { std::process::Command::new(\"test\").output().unwrap_or(panic!(\"oh no\")); } ```` rustc warns that the entire line is an unreachable expression ```` warning: unreachable expression --> src/main.rs:3:6 | 3 | std::process::Command::new(\"test\").output().unwrap_ | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64106", "text": "or_patterns: `unused_parens` lints erroneously on `_a @ (0 | 1)` | ```rust #![feature(or_patterns)] #![allow(incomplete_features)] fn foo() { match 0 { _a @ (0 | 1) => {} _ => {} } let () = 0; // Prevent the ICE in MIR. } ``` results in: ```rust warning: unnecessary parentheses around pattern --> src/lib.rs:6:14 | 6 | _a @ (0 | 1) => {} | ^^^^^^ | labels: A-lints, T-compiler, C-bug, requires-nightly, F-or_patterns", "label": "medium", "label_id": 2} {"id": "rust_64107", "text": "Append implementation of Vec doesn't look safe | Randomly looking at the code of `append()`, https://github.com/rust-lang/rust/blob/master/src/liballoc/vec.rs#L1157, doesn't look safe: ```rust self.append_elements(other.as_slice() as _); other.set_len(0); ``` As, we already copy and set the new `len` before reset other vector `", "label": "medium", "label_id": 2} {"id": "rust_64109", "text": "`miri` no longer builds after rust-lang/rust#63561 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63561, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @HeroicKatora, do you think you would hav | labels: P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_64113", "text": "Weird behavior with type errors in macros | Unfortunately I don't have a reproducer but this is what I think I know: - I had some nested macros that took types as arguments and implemented traits. - Somewhere in the chain I was using a `HashMap`. - `HashMap` was not imported in the scope where the macro was invoked (same s | labels: A-diagnostics, A-macros, T-compiler, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_64117", "text": "Adding method to `consume` an iterator efficiently | Currently, mapping methods for iterator, e.g. `map` and `filter` are implemented in a lazy manner. Which means they would not be calculated until further `consumption`. However, sometimes it can be the case that given an `Iterator` (whatever it actually is) . we just wanted its s | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64126", "text": "faults and weird behavior on armv5te | I'm trying to use rust binaries on an armv5te gateway using yocto(thud, meta-atmel). Depending on the configuration(rust-version, target-flags, lto, optimization) I have anything from a (luckily) working binary over wrong logic-level behavior to segmentation faults. During runtim | labels: O-Arm", "label": "high", "label_id": 1} {"id": "rust_64130", "text": "non-send futures error at point of use, but could cite point of definition in some cases | Consider this example ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5f67107e3c9fb3e10aafd83295b3fbf4)): ```rust #![feature(async_await)] use std::sync::Mutex; fn is_send(t: T) { } async fn foo() { bar(&Mutex::new(22)).await; } asy | labels: C-enhancement, A-diagnostics, T-compiler, A-async-await, AsyncAwait-Polish, AsyncAwait-Triaged", "label": "low", "label_id": 3} {"id": "rust_64132", "text": "rustc: Migrate `__register_diagnostic` and friends to stable proc macros | A few macros used internally in `rustc` for working with error codes still use legacy proc macros (aka syntactic plugins) making `rustc` one of the last (*the* last?) noticeable users of the feature in the ecosystem. They need to be moved to `librustc_macros` and re-implemented u | labels: C-cleanup, A-diagnostics, A-macros, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64134", "text": "overflow evaluating the requirement `[closure@main.rs:41:17: 41:38]: std::ops::Fn<(&i32,)> | Hi Rust team I am pretty new to Rust, but believe I might have found a bug in the rustc compiler that causes the trait checker to loop. Here's the program I am trying to compile: ```rust struct BinTree { left: Option>>, right: Option>>, value: V }", "label": "medium", "label_id": 2} {"id": "rust_64135", "text": "E0507 E0009 should be mutually exclusive | E0507 E0009 should be mutually exclusive ### E0009 cannot bind by-move and by-ref in the same pattern ### E0507 cannot move out of borrowed content # Example [Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9f2f8562e3e24ff49c943fd86cc0ea5d) ``` | labels: A-diagnostics, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64140", "text": "Drop glue is always inlined into caller crate | I was investigating the compile time of a crate recently and came across a surprising aspect of the compiler. It looks like the drop glue, or rather the code necessary to drop a type, is inlined unconditionally into the caller crate, even if there are no generics in play. This pr | labels: A-codegen, I-compiletime, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64143", "text": "ICE in import resolution with renamed crate import | I tried renaming a crate import and a bunch of dependent uses of the crate, and ended up seeing a unexpected panic in the compiler. Log is here: https://gitlab.parity.io/parity/substrate/-/jobs/223357 ``` Compiling srml-support v2.0.0 (/builds/parity/substrate/srml/support) threa | labels: A-resolve, I-ICE, P-medium, T-compiler", "label": "question", "label_id": 4} {"id": "rust_64146", "text": "rustdoc generates illegal

in for struct-like enums | See also #7529, #60403 and #60865 When using a struct-like enum, rustdoc generates the following code for the enums fields: (hand formatted) ```html

Fields of ParseU64Error

**Problem** cannot produce cdylib for the target `wasm32-wasi` **Steps** 1. Add \"cdylib\" to the Cargo.toml, e.g. ``` cargo new check-wasi && cd check-wasi echo \"[lib]\" >> Cargo.toml echo \"crate- | labels: T-compiler, O-wasm, C-feature-accepted", "label": "question", "label_id": 4} {"id": "rust_64163", "text": "`clippy-driver` no longer builds after rust-lang/rust#64160 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64160, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @Centril, do you think yo | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64165", "text": "E0631 has duplicated diagnostics | https://github.com/rust-lang/rust/blob/master/src/test/ui/anonymous-higher-ranked-lifetime.stderr has duplicated redundant diagnostics. We should come up with a deduplicating strategy to avoid them. | labels: E-easy, C-enhancement, A-diagnostics, P-low, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64169", "text": "No unnecessary parentheses warning in types | Types can be parenthesized, which is useful for e.g. `dyn (Foo + 'static)` or similar, but often these parentheses are unnecessary. Whenever a trivial type is parenthesized the compiler should suggest to remove the parentheses ```rust pub fn foo() -> (i32) { 42 } ``` ([Playground | labels: E-easy, C-enhancement, A-lints, E-mentor, T-compiler, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_64170", "text": "File and Metadata should document reasons to prefer *not* to use `is_file()` | As per https://github.com/rust-lang/rust-clippy/issues/4503, there's a bit of a trap you can fall into if you use `is_file()` as a predictor for \"can I probably open and read bytes from this thing\". You *generally* don't want to assert `is_file()` for user specified paths, **espe | labels: C-enhancement, T-libs-api, A-docs", "label": "low", "label_id": 3} {"id": "rust_64173", "text": "Unused lifetime cause ICE | The following code ICE's on stable, beta and nightly: ```Rust use core::mem::size_of; struct Bug<'s> { array: [(); size_of::<&Self>()], } ```
Backtrace: ``` Compiling playground v0.0.1 (/playground) error: internal compiler error: src/librustc_mir/bor | labels: E-hard, I-ICE, E-needs-test, P-medium, T-compiler, A-NLL", "label": "high", "label_id": 1} {"id": "rust_64176", "text": "Lifetime error when Send is enforced on async function return type | Just like a lot of lifetime issues, I'm not actually sure whether this is a bug in the compiler or a bug in my code. The following code: ```rust use std::pin::Pin; use std::future::Future; trait FooRef<'a> { type Elem; fn next_elem(self) -> Pin | labels: T-lang, T-compiler, A-async-await, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_64179", "text": "`rls` no longer builds after rust-lang/rust#64172 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64172, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @Centril, do you think you would have time | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64180", "text": "`rustfmt` no longer builds after rust-lang/rust#64172 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64172, I observed that the tool rustfmt no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rustfmt is needed to fix the fallout. cc @Centril, do you think you would ha | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64183", "text": "Make x86_64-linux-kernel target be tier-2 | This would mean compiling libcore in CI, and publishing those artifacts. This would add a lot of value to the efforts to get Rust support into the mainline kernel, since it will mean all the building can be done with just cargo, no 3rd party tools. I'm happy to do whatever work i", "label": "question", "label_id": 4} {"id": "rust_64184", "text": "Extend `span_label` to include fallback operation | There are occassions where `DiagnosticBuilder::span_label` can be called with a `DUMMY _SP`. The current behavior is we don't show those labels at all in the output. In some cases that is the correct behavior. In others, we proactively look for `DUMMY_SP`s and emit a `note` inste | labels: C-cleanup, A-diagnostics, T-compiler, D-diagnostic-infra", "label": "low", "label_id": 3} {"id": "rust_64185", "text": "Cross-compilation of rust 1.37.0 fails with multiple crate matches | Having dealt with issue #63828, another one crops up which is more directly related to rust. While building, I hit several instances of this particular error message: ``` Compiling rustc-ap-arena v491.0.0 Compiling rustc-ap-syntax_pos v491.0.0 Compiling rustc-ap-rustc_errors v491 | labels: A-cross, O-netbsd", "label": "medium", "label_id": 2} {"id": "rust_64193", "text": "1946-intra-rustdoc-links issue | **Problem** Links created according to [1946-intra-rustdoc-links](https://rust-lang.github.io/rfcs/ | labels: T-rustdoc, C-bug, A-intra-doc-links", "label": "low", "label_id": 3} {"id": "rust_64194", "text": "Maximum number of backtrace frames is not configurable | The standard library currently has a [hard-coded limit of 100 frames](https://github.com/rust-lang/rust/blob/618768492f0c731fcb770dc2d178abe840846419/src/libstd/sys_common/backtrace.rs#L18) when printing a backtrace. However, some applications may have larger call stacks - withou | labels: T-libs-api", "label": "medium", "label_id": 2} {"id": "rust_64196", "text": "Add Fuchsia to actually_monotonic | std's internal [actually_monotonic](https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/time.rs#L311-L315) function is used to determine which platforms' clocks are truly monotonic. Those that aren't (that have been observed to sometimes go backwards in practice) re", "label": "medium", "label_id": 2} {"id": "rust_64197", "text": "Consider moving out-of-line module loading from parser to expansion | Due to module loading parser has to do some not very appropriate for a parser things like - expanding `cfg`s on modules (duplicated with expansion) - keeping the current filesystem position (duplicated with expansion) We also don't really need to load those files until we need to | labels: A-frontend, A-parser, A-macros, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64199", "text": "Poor error message when using `self: Box` | The following code produces a very confusing error message. ```rust struct Foo; impl Foo { fn consume(self: Box) {} } fn bar() { let x = Foo; x.consume(); } ``` ``` error[E0599]: no method named `consume` found for type `Foo` in the current scope --> src/lib.rs:9:7 | 1 | st | labels: A-diagnostics, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64201", "text": "Cannot declare const in function scope that depends on generic impl const | The compiler misreports the following as error 401, saying you can't use generic parameters from an outer function. ```rust trait X { const Y: i32; } trait Z { fn a() -> i32; } struct B { t: std::marker::PhantomData } impl Z for B { fn a() -> i32 { const C: i32 = T", "label": "medium", "label_id": 2} {"id": "rust_64205", "text": "annotate-snippet emitter: Add UI test where `annotated_files` count is > 1 | Part of #59346 It would be nice to have a UI test for the annotate-snippet emitter, that includes annotations that span multiple files. The goal of this issue is to find and add such a test. ## Instructions A simple way to look for this, would be to add this code: ```rust if anno | labels: C-enhancement, A-diagnostics, E-mentor, T-compiler, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_64210", "text": "Curious errors with misused qualified method call syntax | The qualified method call syntax (`::method()`) accepts both tyαΉ•es and modules as the trait. This leads to some interesting errors. ``` fn main() { ::ceil(1.0); ::ceil(1.0); ::ceil(1.0); } ``` Results in ``` error[E0576]: cann | labels: A-diagnostics, T-compiler, C-bug, D-papercut", "label": "medium", "label_id": 2} {"id": "rust_64212", "text": "[Feature Request] compile time arguments | Currently the closest thing to C's preprocessor conditional compilations we have is the cfg and the features. But there's one missing piece, and that's and that's values in those variables. Currently the design idea of features is to be incremental which doesn't make sense with h", "label": "medium", "label_id": 2} {"id": "rust_64214", "text": "HashMap slow compared to hashbrown implementation | Since Rust 1.36 the HashMap implementation in the standard library should be ported from [hashbrown](https://github.com/rust-lang/hashbrown) (see #56241)). But when benchmarking both, hashbrown is a lot faster (3x) on inserts than the HashMap in the standard library: ```bash $ ca", "label": "medium", "label_id": 2} {"id": "rust_64215", "text": "`clippy-driver` no longer builds after rust-lang/rust#64209 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64209, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @Centril, do you think yo | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64217", "text": "Tracking issue: slice_internals? | I was looking at the unstable [`core::slice::memchr`](https://doc.rust-lang.org/core/slice/memchr/fn.memchr.html) API, and couldn't figure out the corresponding tracking issue (it's still set to `#0`). Is there meant to be one? How can I read up on its stabilization status? Thank", "label": "medium", "label_id": 2} {"id": "rust_64218", "text": "LLVM doesn't build on the first try when cross compilling to windows-gnu host | Running `./x.py build --host x86_64-pc-windows-gnu --target x86_64-pc-windows-gnu` from Linux will fail on building LLVM for Windows (so it's 2nd LLVM build) because somehow LLVM_ON_UNIX is defined: ``` /home/mateusz/Projects/rust/rust/src/llvm-project/llvm/include/llvm/Support/F | labels: A-LLVM, O-windows-gnu, T-bootstrap, C-bug", "label": "question", "label_id": 4} {"id": "rust_64219", "text": "Missed optimization: fn type calls returning never are not noreturn | We currently do not annotate calls to function types returning Never as `noreturn`, but we probably should. This is similar to #64090 . | labels: I-slow, C-enhancement, A-codegen, E-needs-test, T-compiler, C-optimization", "label": "low", "label_id": 3} {"id": "rust_64222", "text": "Missed optimization: catch_unwind not removed when closure never unwinds | Consider this C++ code (https://gcc.godbolt.org/z/iaSj6g) ```c++ extern \"C\" void foo() noexcept; int bar() { try { foo(); return 42; } catch(...) { return 13; } } ``` which gets optimized to: ```asm bar(): # @bar() push rax call foo mov eax, 42 pop rcx ret ``` Now consider the se | labels: I-slow, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64223", "text": "Migrate to LLVM{Get,Set}ValueName2 | We currently use the C APIs `LLVM{Get,Set}ValueName` which return/take a 0-terminated `char *`, but those APIs have been deprecated a while ago in favor of `LLVM{Get,Set}ValueName2` which return/take pairs of `char *` + length (the C-friendly lowering of `llvm::StringRef`) which | labels: C-cleanup, A-LLVM, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64224", "text": "Why is the code size of catch_unwind so large ? | While filling #64222 I noticed that we generate more code than C++ for `catch_unwind`. That did not feel right, since C++'s `catch` can do much more than Rust's catch unwind, e.g., filtering different types of exceptions, etc. MWE: C++ (https://gcc.godbolt.org/z/z_dgPg): ```c++ e | labels: C-enhancement, T-libs-api, T-compiler, I-heavy", "label": "low", "label_id": 3} {"id": "rust_64228", "text": "fmt::Debug for right-to-left strings | When formatting strings using fmt::Debug, the normal right-to-left characters are printed as is. This will mangle the entire display line in a rather unpredicable way. [Playground demo](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=03b109a38ef2ecdd7b318f | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64234", "text": "Unnecessary mov instruction | For the following code ```rust extern \"C\" { fn moo(a: i64); } pub unsafe fn baa(a: i64) { if a != 0 { moo(a); } moo(a); } ``` I get the following assembly ```asm example::baa: push rbx mov rbx, rdi test rdi, rdi je .LBB0_2 mov rdi, rbx ;unnecessary call qword ptr [rip + moo@GOTPC", "label": "medium", "label_id": 2} {"id": "rust_64238", "text": "Factor out pluralisation checks in diagnostics | The following pattern is common in diagnostic messages in rustc: ```rust format!(\"found {} thing{}\", x, if x != 1 { \"s\" } else { \"\" }) ``` It would be good to extract all of these pluralisation checks into a function or macro: ```rust format!(\"found {} thing{}\", x, pluralise(x)) | labels: E-easy, C-cleanup, E-mentor, T-compiler, E-help-wanted", "label": "low", "label_id": 3} {"id": "rust_64239", "text": "compiler-rt missing from rustc-1.37.0-src.tar.gz | In #60981 we switched to detecting compiler-rt's presence in `src/llvm-project/compiler-rt` and enabling the `c` feature for `compiler-builtins` if present, falling back to rust-only otherwise. In the git checkout, this works fine, however the `compiler-rt` directory is missing f", "label": "medium", "label_id": 2} {"id": "rust_64244", "text": "`miri` no longer builds after rust-lang/rust#64230 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64230, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have ti | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64245", "text": "Tracking Issue for Cross Compiling Doctests | This is an issue to track the functionality added by [PR#60387](https://github.com/rust-lang/rust/pull/60387), and also by extension [this PR](https://github.com/rust-lang/cargo/pull/6892) in cargo. PR#60387 adds three options to rustdoc: + `--enable-per-target-ignores` which add | labels: T-rustdoc, A-cross, B-unstable, C-tracking-issue, A-doctests, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_64247", "text": "Self::EnumVariant not considered const fn | When using `Self` to create an enum variant in Rust 1.37+, we get an error: ``` const VAL: Self = Self::X(42); ``` results in: ``` error: `Foo::X` is not yet stable as a const fn ``` but if the enum is constructed explicitly, the compilation succeeds: ``` const VAL: Self = Foo::X | labels: A-diagnostics, T-lang, T-compiler, C-feature-request, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_64248", "text": "Builder got stuck on \"Updating crates.io index\" | In https://github.com/rust-lang/rust/pull/64246#issuecomment-529094551, the test-various builder got stuck (https://dev.azure.com/rust-lang/rust/_build/results?buildId=7573): ``` 2019-09-07T06:17:08.8395892Z extracting /checkout/obj/build/cache/2019-08-13/cargo-beta-x86_64-unknow | labels: A-spurious, T-infra, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64249", "text": "`cargo new` generate symbolic link of unknown purpose | Every time I create a new Rust project in a folder that is not the part of Git repository, cargo creates an extra file, which seems to be some kind of symbolic link, with the name of the following format: `_git2_a#####` where the `#` is a (random?) single digit. Example: ```conso", "label": "medium", "label_id": 2} {"id": "rust_64251", "text": "Incorrect mixing of reexport and definition documentation of proc macros | The PR #62855 improved the situation about documenting proc macros. Thanks for that! However, I noticed a bug with it. I'm using `rustc 1.39.0-nightly (6e19f3f38 2019-09-06)`. **`Cargo.toml`** ```toml [package] name = \"doc-bug\" version = \"0.1.0\" authors = [\"me\"] edition = \"2018\" | labels: T-rustdoc, A-macros, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64252", "text": "Diagnostics: help text for missing left-hand side in arbitrary self type | Forgetting to include the left-hand side of an arbitrary self type can give some confusing errors. This was reported by someone trying to implement a future manually, and the diagnostics threw them off. I realize diagnostics for arbitrary self types are an open issue, but figured | labels: C-enhancement, A-diagnostics, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_64260", "text": "Tracking issue for `bool::then_some` | Tracking issue for the `bool::then_some` method, which abstract the following pattern: ```rust if some_condition { Some(t) } else { None } ``` `bool:then` has previously been stabilised as part of this feature gate: https://github.com/rust-lang/rust/pull/79299 RFC: https://github | labels: T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period, requires-nightly", "label": "medium", "label_id": 2} {"id": "rust_64268", "text": "E0514 compiling hello world on nightly-armv7-unknown-linux-gnueabihf | # Steps to reproduce ```sh cargo new --bin compile-fail cd compile-fail rustup override set nightly cargo check --verbose ``` Output: ``` Created binary (application) `compile-fail` package info: using existing install for 'nightly-armv7-unknown-linux-gnueabihf' info: override to", "label": "medium", "label_id": 2} {"id": "rust_64282", "text": "Regression of #63210 param attributes not showing in proc-macro TokenStream | It seems https://github.com/rust-lang/rust/issues/63210 isn't actually fixed. Run `cargo test -- --nocapture` and you'll see the `TokenStream` does not contain any attributes on a parameter: https://github.com/bbqsrc/params-attribute-example | labels: A-pretty, A-attributes, P-high, requires-nightly, F-param_attrs", "label": "high", "label_id": 1} {"id": "rust_64285", "text": "Enforce `min_const_fn` by default in `staged_api` with opt-out | We want to switch to a scheme where everything inside the standard library requires `min_const_fn` by default. If an additional `#[rustc_not_min_const_fn]` is present, then the function will be uncallable from any `min_const_fn`. It's also important to note that a function `#[rus | labels: C-enhancement, A-attributes, P-medium, A-stability, T-compiler, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_64287", "text": "Error: Can't find crate for core | Hi folks! I am testing few things for a rust based operating system. I run make and I get error[E0463]: can't find create for `core` note: the `x-y-unknown-none` target may not be installed When I do `rustc --explain E0463`, I get: ``` A plugin/crate was declared but cannot be fo", "label": "medium", "label_id": 2} {"id": "rust_64289", "text": "Support running with new pass manager | Rustc currently still uses the legacy LLVM pass manager. There's been some discussion about enabling NewPM by default for Clang 10, so we might want to start migrating in that direction as well. To start with, we'd probably want a debug option `-Z llvm-pass-manager=new` that is n | labels: A-LLVM, T-compiler", "label": "question", "label_id": 4} {"id": "rust_64298", "text": "Suggest introduction of new type argument | When writing `impl Trait for X {}` We correctly complain about `T` not being in scope. We should also suggest introducing a new type argument in the correct place. | labels: C-enhancement, A-diagnostics, P-low, T-compiler, A-suggestion-diagnostics, D-papercut", "label": "low", "label_id": 3} {"id": "rust_64300", "text": "RustC Panic | ``` thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', src/libsyntax/source_map.rs:842:17 stack backtrace: thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', src/libsyntax/source_m | labels: I-ICE, A-parser, A-Unicode, A-cross, T-compiler", "label": "high", "label_id": 1} {"id": "rust_64301", "text": "Too many `memcpy`s | Cachegrind profiles indicate that the Rust compiler often spends 3-6% of its executed instructions within `memcpy` (specifically `__memcpy_avx_unaligned_erms` on my Linux box), which is pretty incredible. I have modified DHAT to track `memcpy`/`memmove` calls and have discovered | labels: I-compiletime, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64304", "text": "SGX's std::env::args function is not thread-safe | The `args` method is defined as follows. ```rust pub fn args() -> Args { let args = unsafe { (ARGS.load(Ordering::Relaxed) as *const ArgsStore).as_ref() }; if let Some(args) = args { Args(args.iter()) } else { Args([].iter()) } } ``` Clean-up function is defined as follows; ```ru | labels: T-libs-api, I-unsound, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64305", "text": "Instead of hiding rustdoc search bar by default, disable it | It'd have the advantage of not having the not so pretty effect we have currently when the search bar \"appears\". | labels: T-rustdoc, C-enhancement", "label": "low", "label_id": 3} {"id": "rust_64309", "text": "Doc tests use RUST_LOG variable | ### To reproduce 1. `cargo new --lib doctest_spam` 2. `cd doctest_spam` 3. `RUST_LOG=info cargo test --doc` ### Expected results ``` Finished dev [unoptimized + debuginfo] target(s) in 0.01s Doc-tests doctest_spam running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_64310", "text": "Cannot opt out of LLVM MergeFunctions pass on stable | LLVM's MergeFunctions introduces aliases which can trigger a bug in macOS's `ld64` linker when compiling with ThinLTO: https://github.com/froydnj/ld64-aliases-bug For this reason Firefox has to be built with a patched version of `ld64` when compiling with xLTO. Since the bug in q | labels: A-linkage, A-LLVM, O-macos, A-codegen, T-compiler, I-unsound", "label": "question", "label_id": 4} {"id": "rust_64314", "text": "Add other variants to std::io::ErrorKind enum | I was trying to rewrite Python code in Rust and I need to match against what could be `NotADirectory` (`ENOTDIR`) and saw that `ErrorKind`'s variants do not include many `errno`s present in `libc` - to speak only of the Unix platform - including the one I need. Is there a reason | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64319", "text": "Symbol names may not correctly account for optimization level differences between crates | On investigating https://github.com/rust-lang/wg-cargo-std-aware/issues/32 I've managed to reduce this down to: ``` $ cat foo.rs pub fn foo() { bar::(); } pub fn bar() { baz(); } fn baz() {} $ cat bar.rs extern crate foo; pub fn bar() { foo::foo(); } $ rustc --crate-typ | labels: A-linkage, A-codegen, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64322", "text": "Incorrect doc for checked_duration_since | \"... or None if that instant is earlier than this one\" should be \"... or None if that instant is *later* than this one\" | labels: E-easy, A-docs", "label": "low", "label_id": 3} {"id": "rust_64335", "text": "Missed niche opportunity in simple nested enum | ``` pub enum Foo { A, B, C, } pub enum Bar { Foo(Foo), D, E, } pub enum Foo2 { A(T), B(T), C(T), } pub enum Bar2 { Foo(Foo2), D(T), E(T), } fn main() { use std::mem::size_of; dbg!(size_of::()); // = 1 dbg!(size_of::>()); // = 1 dbg!(size_of::>()); ", "label": "medium", "label_id": 2} {"id": "rust_64336", "text": "manifest path to bootstrap/Cargo.toml does not exist, when it does | I do not know what is going on when I am building rust from source. what is going on is that I run `python x.py build` and it caches `rust-std-beta-i686-pc-windows-gnu` for whatever reason even though I've set my target in config.toml to be `x86_64-pc-cygwin` so I'd think it shou | labels: T-bootstrap, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_64338", "text": "Ffi safe lint ICE with type alias impl trait | ```rust #![feature(type_alias_impl_trait)] type A = impl Fn(); fn ret_closure() -> A { || {} } extern \"C\" { fn a(_: A); } fn main() {} ``` ``` error: internal compiler error: src/librustc_lint/types.rs:858: Unexpected type in foreign function thread 'rustc' panicked at 'Box' | labels: I-ICE, T-compiler, A-impl-trait, C-bug, F-type_alias_impl_trait", "label": "high", "label_id": 1} {"id": "rust_64339", "text": "Error with -Z time-passes | ``` $ rustc --version rustc 1.39.0-nightly (0b36e9dea 2019-09-09) $ export RUSTFLAGS=\"-Z time-passes\" $ cargo build error: failed to parse the cfg from `rustc --print=cfg`, got: ___ lib___.rlib lib___.so lib___.so lib___.a lib___.so /home/erlend/.rustup/toolchains/nightly-x86_64- | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64340", "text": "Linking issue with Rust 1.37.0 | See [build log](https://gist.github.com/vitvakatu/0e76378d0977e6e6dfd5fb5e29473179). It looks like name mangling doesn't work correctly when linking with a dynamic library which is also depends on `libstd`. The application structure is the following: 1. Large `dylib` crate `java_ | labels: A-linkage, P-high, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64341", "text": "toolstate: allow toolstate x->build_fail in rollup PRs | I was trying to implement this myself but was not sure about implementation details, so making a ticket... Currently, a PR that modifies a tool and does not change it to \"test pass\" will fail. If we allowed \"test pass\" -> \"build fail\", \"build fail\" -> \"test fail\", and \"build fail | labels: C-enhancement, T-infra, T-dev-tools", "label": "low", "label_id": 3} {"id": "rust_64343", "text": "debuginfo/pretty-uninitialized-vec fails with `Cannot access memory at address 0x7fffff7fe000` | ``` ---- [debuginfo-gdb+lldb] debuginfo/pretty-uninitialized-vec.rs stdout ---- NOTE: compiletest thinks it is using GDB with native rust support NOTE: compiletest thinks it is using GDB version 8003000 error: gdb failed to execute status: exit code: 1 command: \"/usr/bin/gdb\" \"-q | labels: A-testsuite, A-debuginfo, P-high, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_64345", "text": "decrease compilation time", "label": "medium", "label_id": 2} {"id": "rust_64346", "text": "question: when there will a Cranelift backend will available", "label": "question", "label_id": 4} {"id": "rust_64350", "text": "sender Cannot exit while using nested | When I crawled the web pages with rust and curl, I needed to handle the redirected connections, so I created channels to handle the target, but when all the channels were finished, the program didn't quit and was still waiting I tried drop(), but it didn't work the code: ```rust ", "label": "low", "label_id": 3} {"id": "rust_64352", "text": "Rename `Kind` | A `Kind` is not really a kind: it's a term (e.g. a particular type, a particular lifetime or a particular value). However, \"`Term`\" is overloaded as terms are usually values of particular types (which is just one case here). `KindedTerm` has been suggested. | labels: C-cleanup, I-needs-decision, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64353", "text": "Rename `.sty` field on `TyS` | `.kind` makes more sense, but could be confusing, as it's not a [type-theoretic kind](https://en.wikipedia.org/wiki/Kind_(type_theory)). There's also the issue of having inconsistent ways to name a field containing a `*Kind`, e.g. `.node` and `.kind`. It would be good to make the | labels: C-cleanup, I-needs-decision, T-compiler, S-waiting-on-bikeshed", "label": "low", "label_id": 3} {"id": "rust_64355", "text": "Nightly segfaults in release mode on armv7-unknown-linux-gnueabihf | Building any binary in release mode on `armv7-unknown-linux-gnueabihf` with `nightly-2019-09-09` results in segmentation fault: ```sh $ cargo new foo && cd foo && cargo +nightly build --release Created binary (application) `foo` package Compiling foo v0.1.0 (/tmp/foo) error: Coul | labels: I-crash, O-Arm, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_64356", "text": "Tricky error with `rustc-std-workspace-core` crate. | I'm not very sure whether this is a bug or not. But let me write down the reproduction steps. I'm using the newest stable. Cargo.toml: ``` [package] name = \"dummy\" version = \"0.0.1\" edition = \"2018\" [dependencies] core = { version = \"1.0\", package = \"rustc-std-workspace-core\"} ``", "label": "medium", "label_id": 2} {"id": "rust_64362", "text": "\"variant is never constructed\" lint appears to be incorrect? | This code ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c03d4fa0a396d0476637d39c43bda0c2)) causes a \"variant is never constructed\" lint, even though the variant is constructed in the `FromStr` implementation: ```rust use std::str::FromStr; | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64363", "text": "`miri` no longer builds after rust-lang/rust#64354 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64354, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Centril, do you think you would have ti | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64364", "text": "`extern crate foo as core` breaks resolution in macros | Broken in a recent nightly. Reproducer ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=b2ebe9fed3b69a7eaef700018e5a9b51)): ```rust extern crate futures as core; fn bar() { let _ = format!(\"{}\", 42); } ``` Gives the following: ``` error[E0433", "label": "medium", "label_id": 2} {"id": "rust_64365", "text": "ICE encountered in 1.37 stable borrowck | reproduction branch: https://github.com/spacejam/sled/tree/tyler_ice_ice_baby the last commit is the one-line-change that induces the panic rustc 1.37.0 (eae3437df 2019-08-13) running on x86_64-unknown-linux-gnu ``` Ξ» cargo build --verbose Fresh unicode-xid v0.2.0 Fresh semver-pa | labels: I-ICE, A-borrow-checker, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_64370", "text": "Failure to install cargo package | When attempting to install a binary via cargo, I got a build failure. I tried this code: `cargo install fd-find` I expected to see this happen: Successful installation of fd. Instead, this happened: ``` cargo install fd-find [4:18:39] Updating crates.io index Installing fd-find v | labels: I-ICE, A-metadata, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_64371", "text": "Rustdoc generates illegal \"
\" inside \"
\" with traits | Similar to the previous bugs I've filed in this regard with illegal html: In: 1.39.0-nightly (34e82a7b7 2019-09-10) The following trait definition: ```rust #[cfg_attr( feature = \"external_doc\", doc(include = \"CacheFieldCollection.md\") )] #[cfg_attr( not(feature = \"external_doc\"), | labels: T-rustdoc, C-bug", "label": "low", "label_id": 3}
{"id": "rust_64376", "text": "Document endianess of octets function on ipv4addr/ipv6addr | The docs of the octets function on [ipv6addr](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.octets) and on [ipv4addr](https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.octets) don't tell about the endianess. Network or host order?  src/main.rs:1:10 | 1 | struct S(#[attr] u8); | ^^^^^^^ | = not | labels: A-attributes, I-ICE, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0}
{"id": "rust_64388", "text": "Error diagnostic suggests syntactically invalid code | For the following code ([Playground link]): ```rust fn foo<'a>(u: &'a usize) -> impl IntoIterator + 'a { std::thread::spawn(move || { println!(\"{}\", u); }); vec![] } ``` `rustc` provides the following error and suggestion: ``` error: cannot infer an appropriate life | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2}
{"id": "rust_64389", "text": "Spurious \"found two different crates with name `alloc`\" errors in PR builder | - https://github.com/rust-lang/rust/pull/64378#issuecomment-530412814 - https://github.com/rust-lang/rust/pull/64429#issuecomment-531692042 | labels: T-compiler, A-spurious, T-infra, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64391", "text": "async functions fail to move values into generated futures in the latest nightly | This simple async function fails to compile on the newest nightly: https://github.com/sfackler/rust-postgres/blob/2cc5bbf21b654c26bfd8b1e80b1e5c7cbd81235f/tokio-postgres/src/lib.rs#L163-L172 ``` error[E0597]: `config` does not live long enough --> tokio-postgres/src/lib.rs:171:5  | labels: T-compiler, C-bug, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2}
{"id": "rust_64392", "text": "Async function return type inference fails without an ending return | I have a function of the signature `async fn run() -> Result>`. It ends with a loop that, as you may infer, never returns `Ok`. The inference for code generation failed, and the various compiler errors said that my function actually returned `()`. | labels: T-compiler, A-inference, C-bug, A-async-await", "label": "medium", "label_id": 2}
{"id": "rust_64397", "text": "rustdoc crashes parsing yet another strange doc-comment on 1.37 | I had a similar issue on 1.36 that seemed to have been fixed: https://github.com/rust-lang/rust/issues/62571 That fix looks like it went into 1.37, but I'm getting a crash running on a similar doc comment once again. Here is the offending doc-comment ``` #[doc = \" | _ \\\\ __ _ _ _", "label": "medium", "label_id": 2}
{"id": "rust_64399", "text": "(1<<64) can not be precisely represent by f64  in rust (in c, it is ok) | ```rust fn main() { let a: f64 = 2.0f64.powi(64); println!(\"{}\", a); let a: f64 = 18446744073709551616.0f64; println!(\"{}\", a); // wii output // 18446744073709552000 // 18446744073709552000 } ``` ```c #include  int main() { double a = 18446744073709551616.0; float b = 18 | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64400", "text": "enum variants as expr in macro repetitions | I don't know if this is a bug or not, but I can't seem to get my macro rules to work. It doesn't seem to take enum variants in macro repetitions. Error is: ```` error: arbitrary expressions aren't allowed in patterns --> src/main.rs:34:22 | 34 | \"Con\" => AbilityType::Con, | ^^^^^", "label": "medium", "label_id": 2}
{"id": "rust_64401", "text": "ICE FulfillmentError in trait codegen | When trying to use generic function with capnproto structs the compiler fails to infer types correctly. I failed to distil the problem to a smaller size. Capnproto generates code that implements traits like this ` impl <'a> ::capnp::traits::Owned<'a> for Owned { type Reader = Rea | labels: A-codegen, I-ICE, E-needs-test, T-compiler, C-bug", "label": "high", "label_id": 1}
{"id": "rust_64403", "text": "behavior  about 18446744073709552000f64 is very different in `const`, `let`, `cargo run`, `rustc` | This code ```rust use std::u64; fn main() { const A: f64 = 18446744073709552000.0; println!(\"{}\", A as u64); let b: f64 = 18446744073709552000.0; println!(\"{}\", b as u64); println!(\"{}\", 18446744073709552000.0f64 as u64); } ``` if save it in `1.rs` and `rustc 1.rs && ./1`, the ou", "label": "medium", "label_id": 2}
{"id": "rust_64405", "text": "debuginfo: Line-tables-only mode emits much more debuginfo than Clang | We probably could emit less debuginfo when compiling with `-Cdebuginfo=1` than we do at the moment. Clang 8.0 emits a lot less debuginfo when compiling with `-gline-tables-only`, with debuginfo not containing any `DW_TAG_subprogram` entries; while stepping through the code with g | labels: C-cleanup, A-LLVM, A-debuginfo, T-compiler, C-feature-request", "label": "low", "label_id": 3}
{"id": "rust_64410", "text": "libstd build without backtrace feature broken | Likely because of https://github.com/rust-lang/rust/pull/64154. ``` error[E0432]: unresolved import `crate::sys_common::backtrace` --> sysroot_src/src/libstd/backtrace.rs:98:24 | 98 | use crate::sys_common::backtrace::{output_filename, lock}; | ^^^^^^^^^ could not find `backtrace", "label": "medium", "label_id": 2}
{"id": "rust_64411", "text": "Dead code isn't checked | The following code compiles, runs, and outputs `42` even though it probably shouldn't: ```Rust fn main() { 'a: while break 'a == { let mut s = String::from(\"hahaha\"); let first_move = s; let second_move = s; std::thread::spawn(|| { s.push('!'); }); std::thread::spawn(|| { s.push( | labels: T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64412", "text": "`re_rebalance_coherence` doesn't properly account for fundamental types | As part of an effort to stabilize the `re_rebalance_coherence` RFC (#63599), I was creating tests trying to get more coverage of all possible scenarios, and I found that we don't seem to be handling fundamental types in the way that the RFC specifies. In particular this test is p | labels: A-trait-system, T-compiler, I-unsound, C-bug, requires-nightly, F-re_rebalance_coherence", "label": "critical_bug", "label_id": 0}
{"id": "rust_64417", "text": "The compiler should be more helpful when trait bounds are not met. | Here's a reduced testcase: ``` use std::sync::Arc; struct Foo; #[derive(Clone)] struct Bar(Arc); fn main() { let a = Bar(Arc::new(Foo)); let b = a.clone(); } ``` This fails to compile with: ``` error[E0599]: no method named `clone` found for type `Bar` in the current s | labels: A-diagnostics, A-trait-system, T-compiler, D-confusing", "label": "medium", "label_id": 2}
{"id": "rust_64430", "text": "Confusing `owned_box` error message since nightly-2019-09-04 | Test Program: ```rust // lib.rs #![no_std] pub fn foo() { pub struct Writer; write!(Writer, \"\"); } ``` Error message on nightly [_9af17757b 2019-09-02_] and before: ``` error[E0599]: no method named `write_fmt` found for type `foo::Writer` in the current scope --> src/lib.rs:5:5  | labels: E-easy, A-diagnostics, E-mentor, T-compiler, E-help-wanted, C-bug", "label": "low", "label_id": 3}
{"id": "rust_64433", "text": "Lifetime errors on nightly-2019-09-11 but not nightly-2019-09-10 | The code below will compile without warnings on `nightly-2019-09-10`, but returns a lifetime error on `nightly-2019-09-11` and later. ```rust #[derive(Debug)] struct A<'a> { inner: Vec<&'a str>, } struct B {} impl B { async fn something_with_a(&mut self, a: A<'_>) -> Result<(), S | labels: A-lifetimes, T-compiler, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2}
{"id": "rust_64440", "text": "`clippy-driver` no longer builds after rust-lang/rust#63420 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63420, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @spastorino, do you think | labels: T-compiler", "label": "medium", "label_id": 2}
{"id": "rust_64441", "text": "`miri` no longer builds after rust-lang/rust#63420 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#63420, I observed that the tool miri no longer builds. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @spastorino, do you think you would have  | labels: T-compiler", "label": "medium", "label_id": 2}
{"id": "rust_64445", "text": "Unification fails when type alias impl trait is used in non-return position | The following code fails to compile, but I believe this should be a supported use-case under https://github.com/rust-lang/rfcs/pull/2515 (and https://github.com/rust-lang/rust/issues/63063): ```rust #![feature(type_alias_impl_trait)] type X = impl Iterator + Unpin; st | labels: A-type-system, T-compiler, A-inference, C-bug, F-type_alias_impl_trait", "label": "question", "label_id": 4}
{"id": "rust_64447", "text": "`EmitterWriter::get_max_line_num` works incorrectly | **TL;DR:** [`EmitterWriter::get_max_line_num`](https://github.com/rust-lang/rust/blob/master/src/librustc_errors/emitter.rs#L1037) unconditionally returns `self.get_multispan_max_line_num(span)` no matter what is contained in `children`. Longer explanation: let's take a look at t | labels: A-diagnostics, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64450", "text": "rustc panic with `inconsistent resolution for a macro` for proc macro imported different name for wasm target. | # Context I compile with `cargo check --target=wasm32-unknown-unknown` for a project with a proc macro imported with a different name as such: ```toml [dependencies] curve = { package = \"srml-staking-npos-reward-curve\", path = \"../npos-reward-curve\"} // proc macro ``` and it fail | labels: A-resolve, I-ICE, A-macros, A-cross, T-compiler, C-bug", "label": "high", "label_id": 1}
{"id": "rust_64453", "text": "ICE: borrowck/check_loans: assertion failed: `self.bccx.region_scope_tree.scopes_intersect(...)` | err : ``` D:\\work\\rust\\web_api_rust>cargo build Compiling web_api_rust v0.1.0 (D:\\work\\rust\\web_api_rust) warning: unused variable: `x` --> src\\response_builder.rs:13:20 | 13 | pub fn file_server(x:&str) { | ^ help: consider prefixing with an underscore: `_x` | = note: #[warn(unu | labels: I-ICE, E-needs-test, P-medium, A-borrow-checker, T-compiler, regression-from-stable-to-stable", "label": "critical_bug", "label_id": 0}
{"id": "rust_64458", "text": "Foreign type tests not covering all operations | For example foreign type pointer comparison is not tested. Also `&(*val).0` where field `0` of `*val` is a foreign type is not tested. As a last thing pointer to `*mut ForeignType` casting it not tested. These were all cases which were mishandled in [rustc_codegen_cranelift](http | labels: A-testsuite, C-enhancement, A-FFI, E-needs-test, T-compiler, requires-nightly", "label": "low", "label_id": 3}
{"id": "rust_64460", "text": "Tracking issue for `cmp::{min_by, min_by_key, max_by, max_by_key}` | Tracking issue for the `cmp_min_max_by` feature, which adds the `min_by` / `min_by_key` / `max_by` / `max_by_key` functions to `std::cmp`. PR: #64047 | labels: T-libs-api, B-unstable, C-tracking-issue, Libs-Tracked", "label": "medium", "label_id": 2}
{"id": "rust_64464", "text": "as_ne_bytes for primitive types | Recently I've encountered a problem, when I wanted to return a slice of bytes in an integer: ```rust fn to_bytes(num: &u32) -> &[u8] { &u32::to_le_bytes(*num) } ``` (This is an oversimplification of the original code, which is generic over every integer type along with other stuf | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2}
{"id": "rust_64465", "text": "Suggestion: say \"field is never read\" instead of \"field is never used\" | As of rustc 1.37.0, this code: ```rs pub struct Owl { tree: u16 } fn exist(tree: u16) -> bool { tree > 0 && tree <= 3 } impl Owl { pub fn find(tree: u16) -> Option { if exist(tree) { Some(Owl { tree }) } else { None } } } fn main() { Owl::find(1); } ``` gives the warning: `` | labels: E-easy, C-enhancement, A-diagnostics, T-compiler", "label": "low", "label_id": 3}
{"id": "rust_64476", "text": "The \"unused manifest key\" warning doesn't print or halt the publishing with `cargo publish` | Normally if you have a manifest key that cargo doesn't understand many of the commands will print a warning ``` D:\\dev\\cargo-gba>cargo build warning: unused manifest key: package.repsitory ``` However, if you use `cargo publish` not only does the accidental key not halt the publi", "label": "medium", "label_id": 2}
{"id": "rust_64477", "text": "Spurious new Send requirement in async block | This is minimized from code that was working with nightly-2019-09-10 but broken on nightly-2019-09-11. https://github.com/rust-lang/rust/compare/0b36e9dea...34e82a7b7 ```rust use std::future::Future; use std::pin::Pin; fn f(_: &T) -> Pin + Send>> {  | labels: T-lang, T-compiler, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2}
{"id": "rust_64480", "text": "`rls` no longer builds after rust-lang/rust#60584 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#60584, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @jonas-schievink, do you think you would ha | labels: T-compiler", "label": "medium", "label_id": 2}
{"id": "rust_64484", "text": "Rc/Arc: get rid of \"value\" terminology | The Rc docs use the term \"value\" to refer to an `RcBox` instance (and similar for `Arc`). That's IMO a bad use of terminology: A \"value\" is something like \"5\" or \"true\" that does not have an identity beyond its mathematical interpretation; an `RcBox` has a *location* so that even | labels: A-docs", "label": "low", "label_id": 3}
{"id": "rust_64489", "text": "question: how can i look at macro expansion", "label": "question", "label_id": 4}
{"id": "rust_64490", "text": "Tracking issue for RFC 2582, `&raw [mut | const] $place` (raw_ref_op) | This is a tracking issue for the RFC \"an operator to take a raw reference\" (rust-lang/rfcs#2582), feature(raw_ref_op). **Steps:** - [x] Implement the RFC (see [this comment](https://github.com/rust-lang/rust/issues/64490#issuecomment-531579111) for a detailed checklist) - [x] Adj | labels: B-RFC-approved, T-lang, C-tracking-issue, requires-nightly, F-raw_ref_op, S-tracking-needs-summary", "label": "question", "label_id": 4}
{"id": "rust_64492", "text": "In WSL(Window Subsystem Linux) environment, can't run compiled binary because of Invalid argument error(22) | I use WSL2 ubuntu 18.04, kernel version ```4.19.43-microsoft-standard ```. My WSL $HOME is C drive, so I install rust in C drive(```/home/myname```). But my Rust Worspace is D drive, so I write source file ```main.rs``` in D drive. And this is the result: ``` DESKTOP-750B375:/mnt | labels: O-linux", "label": "medium", "label_id": 2}
{"id": "rust_64493", "text": "Spurious \"unused lifetime parameter\" warning with async function | ```rust #![warn(unused_lifetimes)] async fn async_fn(&ref mut s: &[i32]) {} //~ WARN lifetime parameter `'_` never used ```     src/main.rs:5:8 | 5 | if a { | ^ expected bool, found &bool | = note: expected type | labels: E-easy, A-diagnostics, T-compiler, C-feature-request, A-suggestion-diagnostics, D-papercut", "label": "low", "label_id": 3}
{"id": "rust_64559", "text": "Nonsensical suggestion when trying to move value in 'for' expression into closure | This code: ```rust fn main() { let orig = vec![true]; for _val in orig {} let _closure = || orig; } ``` gives the following error: ``` error[E0382]: use of moved value: `orig` --> src/main.rs:4:20 | 2 | let orig = vec![true]; | ---- move occurs because `orig` has type `std::vec:: | labels: T-compiler, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2}
{"id": "rust_64561", "text": "Ommiting \"C\" in `extern \"C\" fn` in derive input causes spans to get lost. | For some reason ommiting the `\"C\"` in `extern \"C\" fn` causes the spans to get lost in error messages. I've created [this repository](https://github.com/rodrimati1992/fn_abi_span_issue) to demonstrate it,simply git clone it and try to build the `using_proc_macro` crate. The `proc_ | labels: E-easy, A-parser, E-mentor, A-macros, T-compiler, C-bug", "label": "low", "label_id": 3}
{"id": "rust_64563", "text": "the trait std::error::Error is not implemented for getrandom::error::Error | | I am seeing this issue when building rust libstd unit test: error[E0277]: the trait bound getrandom::error::Error: std::error::Error is not satisfied --> /folk/prj-rust-dev/bpang/ala-diab-pb19l/fix_bugs/latest/.cargo/git/checkouts/rand-cc8f5b7ec2d3b6d9/64a4000/rand_core/src/er ro | labels: T-bootstrap, E-needs-mcve", "label": "question", "label_id": 4}
{"id": "rust_64565", "text": "Invalid bound suggestion for argument-position impl trait | The following code: ```rust fn is_send(val: T) {} fn use_impl_sync(val: impl Sync) { is_send(val); } ``` gives the following error: ``` error[E0277]: `impl Sync` cannot be sent between threads safely --> src/lib.rs:4:5 | 1 | fn is_send(val: T) {} | ------------- | labels: A-diagnostics, A-trait-system, T-compiler, A-impl-trait, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2}
{"id": "rust_64568", "text": "Can the Sized bound be removed from Pin::set ? | https://doc.rust-lang.org/beta/src/core/pin.rs.html#599-604 I am looking closely at pinning for the first time and noticed that set requires the target to be sized. This feels like an unnecessary restriction to me. An unsized read or write is simply a no-op, and it's possible to ", "label": "medium", "label_id": 2}
{"id": "rust_64571", "text": "How to generate SEH code | Hello! I am developing a Windows driver and need some SEH code. These codes are implemented in C as follows: ```c do { __try { ProbeForWrite(address, length, 1); break; } __except (1) { if (GetExceptionCode() == STATUS_GUARD_PAGE_VIOLATION) { continue; } return false; } } while (", "label": "critical_bug", "label_id": 0}
{"id": "rust_64573", "text": "Survey on Pull Request Prioritization | Dear Pull Requests integrators, We are an international group of researchers investigating Pull Requests management activities. We implemented an automated approach, named CARTESIAN, for prioritizing Pull Requests (PRs) received by an open-source project according to the likeliho", "label": "medium", "label_id": 2}
{"id": "rust_64577", "text": "Confusing error messages when there are version conflicts | ``` Checking cfg-if v0.1.9 Checking byteorder v0.5.3 Checking slab v0.4.2 Checking libc v0.2.62 Checking byteorder v1.3.2 Checking log v0.4.8 Checking iovec v0.1.2 Checking positioned-io v0.2.2 Checking bytes v0.4.12 Checking lengine v0.1.0 (/Users/kaima/src/lengine) error[E0277]", "label": "medium", "label_id": 2}
{"id": "rust_64587", "text": "String.find(\"\") returns 'Some(0)' when searching for the empty string; expected 'None'. | Hey, Ferris. Thanks for Rust. I was surprised by the result of following code, though... fn main() { let s = \"Ferris\".to_string(); println!(\"{:?}\", s.find(\"F\")); println!(\"{:?}\", s.find(\"e\")); println!(\"{:?}\", s.find(\"r\")); println!(\"{:?}\", s.find(\"Q\")); println!(\"{:?}\", s.find(\"", "label": "medium", "label_id": 2}
{"id": "rust_64590", "text": "Confusing 'unreachable code' error message when macro is involved | This code: ```rust macro_rules! early_return { () => { return () } } fn main() { return early_return!(); } ``` Gives the following warning: ``` warning: unreachable expression --> src/main.rs:8:5 | 8 | return early_return!(); | ^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unreachable_ | labels: C-enhancement, A-diagnostics, A-macros, T-compiler", "label": "low", "label_id": 3}
{"id": "rust_64593", "text": "Unnecessary improper_ctypes warning for extern \"Rust\" | The following code generates an `improper_ctypes` warning: ```rust extern \"Rust\" { fn foo(dest: &mut [u8]) -> Result<(), Error>; } ``` I would expect this sort of warning for an `extern \"C\"` declaration, but it seems incorrect for an `extern \"Rust\"` declaration. Am I misunderstan | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64602", "text": "RFC: Better/Shorter syntax to declare multiple variables | When we have multiple variable to be declared, we need to write something like this: ```Rust let (mut a, mut b, mut c, mut d) = (false, false, false, false); ``` There are two obvious factorizations: The first part is to factorize the `mut` decorator, so to be `let mut (a, b, c,  | labels: needs-rfc", "label": "medium", "label_id": 2}
{"id": "rust_64605", "text": "Huge increase of size of std between 2019-07-07 and 2019-07-08 | ``` curl -sI https://static.rust-lang.org/dist/2019-07-0{7,8}/rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz | rg content-length content-length: 82970771 content-length: 211283629 ``` this is a difference of around 120MiB :/ `librustc` alone has been increased by 60Mib that nig", "label": "medium", "label_id": 2}
{"id": "rust_64607", "text": "compiler rejects to use self in match arm | Hi, I have the following Code [(Playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c436b46fba25c33930edf4f984feec38) ```rust struct S { first: usize, second: usize, } impl S { fn matches(&self, v: usize) -> &'static str { match v { self.first => ", "label": "medium", "label_id": 2}
{"id": "rust_64609", "text": "-C target-feature/-C target-cpu are unsound | In a nutshell, target-features are part of the call ABI, but Rust does not take that into account, and that's the underlying issue causing #63466, #53346, and probably others (feel free to refer them here). For example, for an x86 target without SSE linking these two crates shows | labels: A-codegen, P-medium, T-compiler, I-unsound, C-bug, A-ABI", "label": "question", "label_id": 4}
{"id": "rust_64610", "text": "Compiler crashes during borrow checking. | ```rust struct Data<'a> { data: [u8; Self::SIZE], } impl<'a> Data<'a> { const SIZE: usize = 12; } ``` ``` Compiling playground v0.0.1 (/playground) error: internal compiler error: src/librustc_mir/borrow_check/nll/universal_regions.rs:741: cannot convert `ReEarlyBound(0, 'a)` to  | labels: I-ICE, A-associated-items, A-borrow-checker, T-compiler, C-bug", "label": "high", "label_id": 1}
{"id": "rust_64612", "text": "SIGILL when statically linking with libc++.a on MacOS | I've a Rust project that dynamically links to `libc++` which I'm trying to statically link. Unfortunately building this project on MacOS results in a SIGILL error. I've simplified the project to the following minimal test case: https://github.com/basvandijk/sigill-error/ Building | labels: A-linkage, O-macos, T-compiler, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64614", "text": "Omitting struct field name in cast | ```rust #[derive(Debug)] struct Example { value : u32 } fn main() { let value : i32 = 100; let example = Example { value : value as u32 // cannot remove the \"value :\" }; println!(\"{:#?}\", example) } ``` ([Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2", "label": "medium", "label_id": 2}
{"id": "rust_64620", "text": "Compiler panic when yielding array element from non-generator | Steps to reproduce: 1. Run `cargo new --lib crash`. 2. Replace `src/lib.rs` with this content: ``` #![feature(generators)] pub fn crash(arr: [usize; 1]) { yield arr[0]; } ``` 3. Run `RUST_BACKTRACE=full cargo +nightly build --verbose` to get this output: ``` Compiling crash v0.1. | labels: I-ICE, E-needs-test, T-compiler, C-bug, A-coroutines, F-coroutines", "label": "high", "label_id": 1}
{"id": "rust_64629", "text": "Rust should not link sanitizer runtimes unconditionally | I've noticed today that apparently Rust adds sanitizer runtimes such as the ASan runtime during linking and I found this runtime inside a static archive. As far as I know, these runtimes should not be part of static archives or DSOs, they should only be linked when creating an ex | labels: A-linkage, T-compiler, A-sanitizers, C-bug", "label": "medium", "label_id": 2}
{"id": "rust_64630", "text": "Async struct method, <_'> lifetime shadowing | Hello, I ran into a problem using `<'_>` lifetime with async struct methods, here is the example: struct Foo<'a> { swag: &'a i32 } impl Foo<'_> { async fn bar(&self) -> i32 { 1337 } } The error is: `error[E0496]: lifetime name `'_` shadows a lifetime name that is already in scope | labels: A-lifetimes, T-compiler, C-bug, A-async-await, AsyncAwait-Polish", "label": "medium", "label_id": 2}
{"id": "rust_64633", "text": "How to handle reservation impls in rustdoc / error messages | I've opened this issue for discussion on how to handle reservation impls (see https://github.com/rust-lang/rust/issues/64631) in rustdoc and how to handle their error messages. | labels: A-trait-system, T-lang, requires-nightly, F-rustc_attrs", "label": "question", "label_id": 4}
{"id": "rust_64636", "text": "async functions with `unimplemented!()` are marked as unreachable | can reproduce with ```rust async fn example(){ unimplemented!() } ``` results in ``` warning: unreachable expression --> src/main.rs:1:19 | 1 | async fn example(){ | ___________________^ 2 | | unimplemented!() 3 | | } | |_^ | = note: `#[warn(unreachable_code)]` on by default ```  | labels: A-lints, T-compiler, C-bug, A-async-await", "label": "medium", "label_id": 2}
{"id": "rust_64638", "text": "ICE with return outside of function body | The following ICE's on stable, beta and nightly: ```Rust enum Bug { V1 = return [0][0] } ``` 
Backtrace: ``` error: internal compiler error: src/librustc/ty/context.rs:556: node_type: no type for node `expr [0] (hir_id=HirId { owner: DefIndex(12), loca | labels: I-ICE, P-medium, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64651", "text": "Invalid `unreachable_code` in `async fn`. | From Rust `nightly-2019-09-16` to `nightly-2019-06-18`, something has caused the following code to start throwing an unreachable expression warning. Changing it from an `async fn` to an `fn` throws no warnings. ```rust async fn read_until(r: &mut std::net::TcpStream, byte: u8) ->", "label": "medium", "label_id": 2} {"id": "rust_64655", "text": "Drop implementations not being called on panic with Fat LTO. | Hi, It looks like calls to `Drop::drop()` are getting removed when using `lto = \"fat\"` for a release build. It doesn't seem to occur with `lto = \"thin\"` or `lto = \"no\"`. I've got a test case here: https://github.com/cstorey/fat-lto-drop-repro, which can be reproduced like this: ` | labels: A-destructors, P-high, T-compiler, regression-from-stable-to-stable, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64659", "text": "Rustc panics while compiling gstreamer in RLS | RLS cannot build my project, which uses gstreamer. Compiling it normally with rustc works fine. `rustc 1.39.0-nightly (eceec57f7 2019-09-18)` `x86_64-unknown-linux-gnu` Affected project for reference: https://gitlab.gnome.org/World/Shortwave I launched RLS manually with `RUST_LOG | labels: I-ICE, P-high, T-compiler, A-save-analysis, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_64662", "text": "ICE: enum discriminant depends on generic arguments | Following code ICEs on today's nightly (97e58c0d3 2019-09-20): ```rust enum Foo { A = foo(), B = foo(), // <- error: internal compiler error: src/librustc/ty/mod.rs:2400: enum discriminant depends on generic arguments } const fn foo() -> isize { 0 } ``` What's peculiar is that | labels: E-needs-test, T-compiler, C-bug, A-const-eval", "label": "high", "label_id": 1} {"id": "rust_64667", "text": "Rust Language Server panicked at 'Box', | Using repo https://github.com/amethyst/amethyst-starter-2d.git @ fd8bff9ea61 `rustc 1.39.0-nightly (9b9d2aff8 2019-09-19)` `cargo 1.39.0-nightly (3596cb86b 2019-09-19)` `rls 1.39.0 (d9aa23a 2019-09-15)` I start `RUST_BACKTRACE=1 rls --cli` in `$ .../amethyst-starter-2d` and get: ", "label": "high", "label_id": 1} {"id": "rust_64668", "text": "Outdated `--explain` text for E0432 \"An import was unresolved.\" | See [E0432][1] for the current text. [1]: https://doc.rust-lang.org/error-index.html#E0432 It currently includes: Β« Paths in `use` statements are relative to the crate root. To import items relative to the current and parent modules, use the `self::` and `super::` prefixes, respe | labels: A-resolve, T-compiler, A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_64680", "text": "Compiler crash when using RLS | Trying to use RLS in neovim (https://github.com/autozimu/LanguageClient-neovim/issues/889#issuecomment-533800654) ``` {\"message\": \"src/librustc/ty/context.rs:211: node type ::Item (hir_id=HirId { owner: DefIndex(246), local_id: 15 }) with HirId::owner DefId(0:246 ~ rayon[3354]", "label": "high", "label_id": 1} {"id": "rust_64681", "text": "Wrong infered type when an additional constrain added | In the function `f` I have to specify `bool` explicitly while `f` differs from `g` in constrains only: ```rust use rand::Rng; use rand::distributions::{Distribution, Standard}; fn f(rng: &mut R) -> bool where R: Rng, Standard: Distribution, { rng.gen::() } fn g( | labels: A-trait-system, T-compiler, A-inference, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64682", "text": "proc-macro param attrs dropping first attrs in impl fns | I have been able to reproduce https://github.com/rust-lang/rust/issues/64282. If an `fn` inside an `impl` has a param attr on the first parameter, no matter how many, they are not visible in the `TokenStream`. Repro repo: https://github.com/bbqsrc/params-attribute-example Source: | labels: A-attributes, A-macros, P-high, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_64686", "text": "Incorrect description of std::prelude name resolution in standard library docs | The [documentation for `std::prelude`][1] states: [1]: https://doc.rust-lang.org/std/prelude/index.html > On a technical level, Rust inserts > > ``` > extern crate std; > ``` > > into the crate root of every crate, and > > ``` > use std::prelude::v1::*; > ``` > > into every modul | labels: A-resolve, T-lang, A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_64693", "text": "Request: add an impl for `f32::try_from(i32)` | It appears that there's no `TryFrom` support on the `f32` type. | labels: T-libs-api, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_64701", "text": "Two function generic type bounds creates nonsense | This is rather silly -- ``` pub fn poll_events(input_component: &mut Input, window: &mut Window, callback: F) where F: FnMut(Event, &mut Window), { ``` This function will compile except that no one can call it. If you only put in one parameter, it yells to have t", "label": "medium", "label_id": 2} {"id": "rust_64704", "text": "rustc panicked in RLS. \"node type ::NodeId (...) cannot be placed in TypeckTables with local_id_root\" | Not sure if there are similar issues, so I open a new one. In my project https://gitlab.com/gentoid/oxyfy/merge_requests/7 I updated deps (see [the diff](https://gitlab.com/gentoid/oxyfy/merge_requests/7/diffs?diff_id=55967431&start_sha=ef363f13ee24afe36fa22dc7c131cd9bc9c278cb)) ", "label": "high", "label_id": 1} {"id": "rust_64705", "text": "ICE when `cargo doc` on `lexical-core`: attempted .def_id() on invalid res: Err | I tried this code: Running `cargo doc` on a project that has `lexical-core 0.6.2` as its direct or indirect dependency. I expected to see this happen: All packages documented. Instead, this happened: `error: internal compiler error: src/librustc/hir/def | labels: T-rustdoc, A-resolve, I-ICE, A-visibility, A-macros, P-high", "label": "critical_bug", "label_id": 0} {"id": "rust_64707", "text": "ICE with const_generic and integration test | Searched a bit, but did not find the same issue. When using const_generics and trying to get an integration test (or benchmark) to run, the compiler ICEs. I tried this code: src/lib.rs: ``` #![feature(const_generics)] pub struct Foo { pub coords: [u8; D], } pub fn | labels: I-ICE, A-metadata, T-compiler, C-bug, A-const-generics, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_64710", "text": "cmp::max changed behavior in nightly | This program ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=8cac9661ef1e135fc25d94f33027c9f0)) changed behavior between https://github.com/rust-lang/rust/compare/97e58c0d3...1dd188489. And broke bindgen as a result in funny ways. ```rust us", "label": "medium", "label_id": 2} {"id": "rust_64712", "text": "Compiler option to augment implicitly typed variables in the code with explicit type information | Hi, Type inference is nice. You can write code faster since you don't have to change type annotations all over the place when you change the type of one thing somewhere. On the other hand, I also think that in some cases it takes more time to grok implicitly typed code, especiall", "label": "low", "label_id": 3} {"id": "rust_64723", "text": "Unused variable warning is emitted on trait method with default implementation | https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1229cc645454ceb61ca781b7ad4a6116 If you have a default implementation of a trait inline with the declaration, in which you don't use a parameter, the compiler will warn about the unused variable and suggest t | labels: C-enhancement, A-lints, T-lang", "label": "low", "label_id": 3} {"id": "rust_64727", "text": "Request: Lossy way to move `Vec` into a `String` | If you have a `Vec` of utf8 data there's three ways to get a `String`: * `from_utf8(vec: Vec) -> Result` * `from_utf8_lossy(v: &'a [u8]) -> Cow<'a, str>` * `unsafe fn from_utf8_unchecked(bytes: Vec) -> String` There doesn't appear to be any way | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64729", "text": "`rustc` v1.37.0 freezing when passed `--emit` | I am distributing `rust 1.37.0` (obtained through `rustup`) inside of an Alpine linux-based container for cross-compiling software for a large number target architectures. While I have successfully managed to install `rustc` in such a way that I can compile (using `rustc --target | labels: A-driver, T-compiler, C-bug, I-hang", "label": "medium", "label_id": 2} {"id": "rust_64730", "text": "error: internal compiler error: src/librustc_metadata/decoder.rs:483: entry: id not found: DefIndex(86) in crate aljabar with number 15 | Hey everybody :) I was trying to test matrix*vector in aljabar crate by running \"cargo test\" on: ``` extern crate aljabar; use aljabar::{matrix, vector}; #[cfg(test)] mod tests { use super::*; #[test] fn identity() { let pixel = vector![0,255,255,15]; let kernel = matrix![ [0,0,0 | labels: A-metadata, T-compiler, C-bug, A-const-generics, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_64731", "text": "Clarify when dependencies are linked | The reference documents that [exern crate](https://doc.rust-lang.org/reference/items/extern-crates.html) has some documentation on linkage of dependencies, but appears to relate to Edition 2015 (or at least not mention linking without `extern crate`). We are considering use of `e | labels: A-linkage, C-enhancement, T-compiler, A-docs", "label": "low", "label_id": 3} {"id": "rust_64732", "text": "Incorrect error message for byte literal with single quotes | When creating a byte literal with single quotes, like `b'hello\\0'`, The error message says: ``` error: character literal may only contain one codepoint --> src/wire_protocol/operations.rs:101:37 | 101 | assert_eq!(Bson::Binary(4, b'12345').byte_length().unwrap(), 10); | ^^^^^^^ h | labels: E-easy, C-enhancement, A-diagnostics, E-mentor, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64734", "text": "repr attributes can be applied at module level | Spot what's wrong with this code: ```rust #![repr(C)] struct Foo(i32); extern \"C\" { fn foo(x: Foo); } fn main() {} ``` ([Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fda6cbd1d9bcae478712b342a354ee1d)) For some reason, top-level `#![repr(..)] | labels: A-attributes, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64744", "text": "ICE 'index out of bounds: the len is 0 but the index is 0', src/librustc_typeck/check/pat.rs:729:23 | commit that introduced ICE: https://github.com/najamelan/pharos/commit/fa9b467ad928d4c1b42cef9637e44915e816ab82 The ICE happens on `cargo check`. The most fundamental change here I imagine is introducing `continue` inside the match...
Backtrace

``` | labels: E-easy, A-diagnostics, I-ICE, regression-from-stable-to-nightly, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64750", "text": "Parallel compiler jobserver management strategy | I tested out a full crate build of the Cargo crate graph in release mode with a parallel rustc compiler today but it unfortunately regressed the build time relative to nightly by about 20%! The cause of the regression appears to be an enormous amount of time spent in the kernel, | labels: I-compiletime, T-compiler, A-parallel-compiler", "label": "question", "label_id": 4} {"id": "rust_64755", "text": "GAT impl with type parameter causes ICE, even without feature enabled | This also applies to stable rust, since it still ICEs without the feature gate, though of course on stable there's no way to encounter it without having another error due to the feature not being enabled. It's similar to #60654 but with type parameters instead of lifetime paramet | labels: I-ICE, T-compiler, C-bug, requires-nightly, F-generic_associated_types, glacier", "label": "high", "label_id": 1} {"id": "rust_64760", "text": "Incorrect note for expected type in E0271 when using an associated type | With the following code: ``` #[derive(Debug)] struct Data {} fn do_stuff<'a>(iterator: impl Iterator) { for item in iterator { println!(\"{:?}\", item) } } fn main() { let v = vec![Data {}]; do_stuff(v.into_iter()); } ``` the diagnostic (in nightly & stable) wrongl | labels: A-diagnostics, T-compiler, C-bug, D-incorrect", "label": "medium", "label_id": 2} {"id": "rust_64761", "text": "Missing backslash in std::ascii::escape_default docs due to faulty rustdoc rendering | In the [documentation for std::ascii::escape_default](https://doc.rust-lang.org/std/ascii/fn.escape_default.html) the doc comment fragment ```Double quote is escaped as `\\\"`.``` is incorrectly rendered as > Double quote is escaped as `\"`. (note the missing backslash) instead of t | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_64762", "text": "Lint `unreachable_pub` got easily confused by multiple items in a single `pub use ...` statement | This code ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6f6d3006c4df35712474dc8fa6ab8442)) trips `unreachable_pub` lint (while being completely legit). ```rust #![deny(unreachable_pub)] pub use self::m1::{Item1, Item2}; mod m1 { pub use sel | labels: A-lints, A-visibility, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64767", "text": "move of mutably borrowed content results in a 'use-after-move' bug | Having played around with rust I encountered something I consider to be violating rust's ownership rules and manifests as a dreaded _use-after-move_ bug. I managed to reduce the error to the next example of a linked list where use-after-move manifests as an endless loop. Maybe an", "label": "medium", "label_id": 2} {"id": "rust_64768", "text": "ICE when using target_feature with a const | The following code snippet triggers a ICE: ```rust #[target_feature(avx2)] const FOO: usize = 7; ``` `rustc 1.37.0 (eae3437df 2019-08-13) running on x86_64-unknown-linux-gnu` Bug was found on playground | labels: A-type-system, I-ICE, P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_64769", "text": "stray \"not covered\" diagnostic in JSON output | Since #64271, the E0005 error has begun emitting a strange \"not covered\" span in the JSON output. This does not appear in the normal \"human\" rendered output. Sample code: ```rust #![allow(unused)] fn main() { let x = Some(1); let Some(y) = x; } ``` With `--error-format=json`, thi | labels: A-diagnostics, P-low, T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_64770", "text": "Issue with #[used] static being removed | ``` #[derive(Copy, Clone, Eq, PartialEq, Debug)] enum CRP { #[used] CRP0 = 0x00000000, // All functions enabled #[used] CRP1 = 0x12345678, // SWD disabled, partial update enabled, except sector 0 #[used] CRP2 = -0x789ABCDF, // 0x87654321, // SWD disabled, full erase only #[used] | labels: E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_64771", "text": "error: cannot find derive macro `Copy` in this scope | I am seeing this issue when building latest rust with latest libc: ``` error: cannot find derive macro Copy in this scope --> /folk/prj-rust-dev/bpang/V7LIBC-997/dev/.cargo/git/checkouts/libc-d1297d136f47e864/3a9e5d0/src/unix/linux_like/linux/gnu/b64/x8 6_64/align.rs:1:10 | 1 | #", "label": "medium", "label_id": 2} {"id": "rust_64775", "text": "Rustc should show an unused_attribute warning when #[inline] is used on trait methods without body | Re: https://github.com/rust-lang/rust/issues/47475 https://github.com/rust-lang/rust-clippy/pull/2367#issuecomment-358255935 > I think this should some day be caught by the unused_attribute lint from rustc | labels: C-enhancement, A-lints, A-trait-system, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64777", "text": "`clippy-driver` no longer builds after rust-lang/rust#64766 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64766, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @Centril, do you think yo | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64779", "text": "build.rs: `rerun-if-env-changed` should mean \"changed compared to last execution of the same kind\" (check vs build/run) | Currently, it seems that build.rs scripts share the same environment when run by `cargo build`/`cargo run` and `cargo check`. This is a problem which leads to unnecessary rebuilds of `libsqlite3-sys` whenever I have `cargo watch -x run` running in cmd.exe, when I then do `cargo c", "label": "medium", "label_id": 2} {"id": "rust_64784", "text": "Declarative macros can create infinite glob import cycles | The following code results in `A` being cyclicly glob imported from `x` into `y` and back with a different identifier (it gains a new mark on each import). ```rust #![feature(decl_macro)] pub macro m($i:ident, $j:ident) { mod $i { pub use crate::$j::*; pub struct A; } } m!(x, y); | labels: I-ICE, E-needs-test, T-compiler, A-decl-macros-2-0, requires-nightly, F-decl_macro", "label": "high", "label_id": 1} {"id": "rust_64788", "text": "Cargo fails building `image` on osx nightly | See this build job: https://travis-ci.org/image-rs/image/jobs/589672851 There is no backtrace or error, just: > thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', src/tools/cargo/src/cargo/util/cpu.rs:152:29 It has already reproduced a second time o", "label": "medium", "label_id": 2} {"id": "rust_64789", "text": "Suggestion: Option::take_if() | Suggestion: Adding `Option::take_if()`. It takes a predicate (similar to filter, but for conditional `.take()`): ```rust pub fn take_if

(&mut self, predicate: P) -> Option where P: FnOnce(&T) -> bool { match self { Some(x) if predicate(x) => self.take(), _ => None, } } ``` | labels: T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64792", "text": "ICE when combining wrong syntax with Unicode string literal | In syntactically erroneous inputs, non-ASCII string literals can cause a compiler panic. Being a dilettante with fingers used to C++, I tried to initialize a struct without calling its `new` method, and it so happened that I was passing it a non-ASCII string. This gave me a compi | labels: A-resolve, I-ICE, A-Unicode, E-needs-test, P-medium, T-compiler", "label": "high", "label_id": 1} {"id": "rust_64798", "text": "`miri` no longer builds after rust-lang/rust#64785 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64785, I observed that the tool miri has failing tests. A follow-up PR to the repository https://github.com/rust-lang/miri is needed to fix the fallout. cc @Manishearth, do you think you would hav | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64803", "text": "error: internal compiler error: unexpected panic: inconsistent resolution for a macro | Compiling this: https://github.com/scullionw/eseabuddy/tree/compiler_bug ``` #[macro_use] extern crate pypack; use pypack::{rust_embed, RustEmbed, RustEmbedExt}; #[derive(RustEmbed)] #[folder = \"dist/\"] struct Python; fn main() { Python::dump_and_exec(); } ``` Results in an ICE: | labels: A-resolve, I-ICE, A-macros, P-high, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_64806", "text": "Should warn when trying to cast between a fat pointer and a non-fat pointer | Please see the following piece of code (I came up with when discussing in our Rust group): ```rust use std::boxed::Box; use libc::c_void; fn main() { show_ptr(get_ptr()); } fn get_ptr() -> *mut c_void { let x = vec![\"Hello\".to_string(), \"World\".to_string()].into_boxed_slice(); Bo", "label": "medium", "label_id": 2} {"id": "rust_64808", "text": "`clippy-driver` no longer builds after rust-lang/rust#64513 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64513, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @varkor, do you think you | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64811", "text": "Add a lint to force adding at least one test for each error code? | A lot of error codes currently don't have ui tests nor long error explanation, therefore we cannot know if they're still thrown by the compiler which isn't an ideal situation... Should we add lint/check for this? cc @rust-lang/compiler | labels: C-enhancement, A-lints, T-compiler", "label": "low", "label_id": 3} {"id": "rust_64821", "text": "Internal compiler error but only when running under rls | I wasn't sure if it was right to report this here or elsewhere, so here it is for now... Trying to compile [Hagrid](https://gitlab.com/hagrid-keyserver/hagrid.git) with `rustc 1.39.0-nightly (6ef275e6c 2019-09-24)` works, but running the `rls --cli` from the same toolchain result | labels: I-ICE, P-high, T-compiler, A-save-analysis", "label": "high", "label_id": 1} {"id": "rust_64822", "text": "-rpath argument passed even when disabled in target | This occurs specifically when building libcore, libstd, liballoc, etc. for Emscripten, as observed in https://github.com/rust-lang/rust/pull/63649. A workaround was added upstream in https://github.com/emscripten-core/emscripten/pull/9475, but we would be able to remove that work | labels: A-linkage, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_64827", "text": "`x.py check` should support `--tests` and `--all` | `cargo check` supports these flags, but it seems `x.py` does not. This means issues in tests can be overlooked, as in https://github.com/rust-lang/rust/pull/64813#issuecomment-535729781. | labels: C-enhancement, T-compiler, T-bootstrap, T-infra", "label": "question", "label_id": 4} {"id": "rust_64829", "text": "Compiler error message is confusing | I don't know what caused this error. Sorry, I can't provide simple code to reproduce it. ![rust-compiler-error](https://user-images.githubusercontent.com/21213088/65736836-0b308900-e10f-11e9-9a1a-c6ef879fbc4a.jpg) ``` bash $ rustup show Default host: x86_64-apple-darwin installed | labels: A-diagnostics, T-compiler, C-bug, E-needs-mcve, D-confusing", "label": "question", "label_id": 4} {"id": "rust_64832", "text": "1.38: internal compiler error running `cargo clippy` on project with `mysql_common` dependency | ``` ... Checking mysql_common v0.18.0 error: internal compiler error: src/librustc/ty/context.rs:516: node_type: no type for node `expr 5 (hir_id=HirId { owner: DefIndex(228), local_id: 255 })` thread 'rustc' panicked at 'Box', src/librustc_errors/lib.rs:644:9 note: run with", "label": "high", "label_id": 1} {"id": "rust_64833", "text": "Failed to run `cargo rustc --profile=check -- -Zunstable-options --pretty=expanded` on simple code with comments | Code: ```rust fn main() {} /* */ ``` Command (used to expand macros): ```shell RUST_BACKTRACE=full cargo rustc --profile=check -- -Zunstable-options --pretty=expanded ``` Result: ``` thread 'rustc' panicked at 'assertion failed: `(left == right)` left: `2`, right: `1`', src/libsy | labels: I-ICE, T-compiler, C-bug, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_64834", "text": "Segfault when using rust inside a go program | This is really a weird bug that occurs on one of our program, i managed to make a reproducable example under this repository: https://github.com/joelwurtz/segfault-golang-with-rust This only happens when calling a specific function on the https://github.com/servo/html5ever librar | labels: C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_64835", "text": "Rust beta crash when running cargo clippy with index out of bound error on travis ci osx | Rust beta currently crash out when cargo clippy in run on travis CI. https://travis-ci.com/iamsauravsharma/cargo-trim/jobs/239695854#L121 If I am correct this issue was fixed by #64774 over nightly but it didn't land over beta rust branch so beta rust is still failing on travis C", "label": "medium", "label_id": 2} {"id": "rust_64839", "text": "`remap-path-prefix` is not convenient to use in .cargo/config for privacy | Let's say when building your executable for release, you have this goal: Maximum privacy, strip all paths associated with the build machine from the release executable. Requirements: - it should be doable with no cmd line flags (just a fixed `.cargo/config`) - it should work rega | labels: A-driver, C-enhancement, T-compiler, T-cargo, C-feature-request, A-reproducibility", "label": "low", "label_id": 3} {"id": "rust_64843", "text": "`clippy-driver` no longer builds after rust-lang/rust#64813 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64813, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @varkor, do you think you | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64844", "text": "Misleading documentation in `std::option` module | The current [`std::option` module](https://doc.rust-lang.org/std/option/index.html#options-and-pointers-nullable-pointers) states, that > Rust's pointer types must always point to a valid location; there are no \"null\" pointers. Which is obviously wrong. There are no null referenc | labels: A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_64848", "text": "ICE: Associated constant and impl trait | When the associated constant of an impl trait is referenced it creates an ICE: ```rust trait AssociatedConstant { const DATA: (); } impl AssociatedConstant for F where F: FnOnce() -> T, T: AssociatedConstant, { const DATA: () = T::DATA; } impl AssociatedConstant for () { co | labels: I-ICE, E-needs-test, P-medium, A-associated-items, T-compiler, A-impl-trait", "label": "high", "label_id": 1} {"id": "rust_64853", "text": "Should async/await be strict keywords? | My impression is that `async` and `await` should be strict keywords. They are currently marked as \"unused\" or \"reserved\" ([unused](https://github.com/rust-lang/rust/blob/6d07874e883ae4334b42ef3ab04cc3f52ee711ee/src/libsyntax_pos/symbol.rs#L1093-L1095), [unstable](https://github.c | labels: A-diagnostics, T-lang, T-compiler, C-bug, A-async-await", "label": "medium", "label_id": 2} {"id": "rust_64854", "text": "push() onto const Vec is doing nothing, no warning either | ```` rustc 1.39.0-nightly (6ef275e6c 2019-09-24) binary: rustc commit-hash: 6ef275e6c3cb1384ec78128eceeb4963ff788dca commit-date: 2019-09-24 host: x86_64-unknown-linux-gnu release: 1.39.0-nightly LLVM version: 9.0 ```` ````rust fn main() { const X: Vec = Vec::new(); X.push(3 | labels: C-enhancement, A-lints, T-lang, T-compiler, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_64855", "text": "ICE \"unexpected region in outlives inference: ReEmpty\" | Internal compiler error `unexpected region in outlives inference: ReEmpty` when missing `Self` bound on struct. Reproducible on stable/beta/nightly on [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a3b57d05596def04acd1f181d43b33ce). Also, no | labels: A-lifetimes, I-ICE, P-high, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_64857", "text": "Need to cherry pick LLVM support for wasm exceptions | [This LLVM commit](https://github.com/llvm/llvm-project/commit/5c3cdef84b82464756bb571c13c31cf7773860c3) makes Emscripten's LLVM backend exception handling scheme work with aggregate types returned by value. This commit needs to be included in Rust's LLVM fork in order to re-enab | labels: A-LLVM, T-compiler, O-asmjs, O-emscripten", "label": "question", "label_id": 4} {"id": "rust_64863", "text": "src/librustc/ich/impls_ty.rs:209: ty::TyKind::hash_stable() - can't hash a TyVid _#1t. | The following ```rust #![feature(const_generics)] struct A([T; N]); impl A { fn bar() -> Self { panic!() } fn foo() -> Self { A::bar() } } fn main() { println!(\"Hello, world!\"); } ``` gives ``` warning: the feature `const_generics` is | labels: I-ICE, T-compiler, A-incr-comp, C-bug, A-const-generics, requires-nightly", "label": "high", "label_id": 1} {"id": "rust_64865", "text": "rustc assertion failure (librustc_codegen_llvm/consts.rs:459) | I'm not sure this has already been reported, but I ran into this today. Unfortunately I don't have a good idea what's causing it, it suddenly appeared after refactoring some code. Deleting `target` and building from scratch did not help. ``` thread 'rustc' panicked at 'assertion | labels: O-macos, A-codegen, I-ICE, O-x86_64, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_64866", "text": "Trait bound not satisfied when using trait constant in array expression | The following code fails on `nightly`/`beta`/`stable` ```Rust trait Trait { const SIZE: usize; } fn foo(v: &T) where T: Trait { [0i32; ::SIZE]; } ``` with the following error: ``` error[E0277]: the trait bound `T: Trait` is not satisfied --> src/lib.rs:6:12 | 6 | [ | labels: A-lazy-normalization", "label": "medium", "label_id": 2} {"id": "rust_64867", "text": "`clippy-driver` no longer builds after rust-lang/rust#64864 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#64864, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @Centril, do you think yo | labels: P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_64869", "text": "async dyn Trait type deduction | For standart functions rust deduct conversion from `Box::new(something)` to `Box`, but in async we need use `as Box`: ```rust pub trait Trait: Send {} #[derive(Default)] struct Test; impl Trait for Test {} pub fn test() -> Box { Box::new", "label": "medium", "label_id": 2} {"id": "rust_64872", "text": "linking of libtest failed | Probably regressed in #64324 (Fix mixing crates with different `share_generics`) ``` $ rustc -V rustc 1.40.0-nightly (084beb83e 2019-09-27) $ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git $ cd rustc_codegen_cranelift $ git checkout 44792f108949048c8945a29e6eee6a | labels: A-linkage, O-macos, P-high, T-compiler, regression-from-stable-to-beta, A-libtest", "label": "critical_bug", "label_id": 0} {"id": "rust_64879", "text": "Detect match arm guard preceded by `|` in the parser | Detect and recover [the following incorrect code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=81fbc7b20fd10c78f5078956c0dcee50): ```rust enum E { A, B, } fn main() { match E::A { E::A | E::B | // This pipe or operand shouldn't be here if true => {} _ | labels: C-enhancement, A-diagnostics, A-parser, P-low, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_64889", "text": "error: internal compiler error: src/librustc/ty/context.rs:513: node_type: no type for node `expr 8 (hir_id=HirId { owner: DefIndex(3061), local_id: 87 })` | Running `cargo clippy` on a [scryer-prolog]() Rust project with a latest master (commit https://github.com/mthom/scryer-prolog/commit/5ec4dfedb0f7f2440316dc02792869ca45b91df0) checkout makes compiler fail: ``` scryer-prolog on ξ‚  master took 26s [i] β„€ RUST_BACKTRACE=full cargo cli | labels: I-ICE, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_64892", "text": "Support AutoFDO (sample-based PGO) | AutoFDO is a variant of PGO with less compile-time tradeoff. A few modifications are needed on rustc side to make it possible: - \"profile-sample-use\": a LLVM option to load the profile. This is very similar to \"profile-use\" and can be trivially implemented. - \"debug-info-for-prof | labels: A-LLVM, A-codegen, T-compiler, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_64897", "text": "Rust playground Favicon | I'm not sure that this is the right place to post this issue, but let's try. The actual Rust Playground https://play.rust-lang.org/ doesn't have a Fivicon and it looks really bad in the bookmark bar. If there aren't any specific issue with it, is it possible to add one?", "label": "medium", "label_id": 2} {"id": "rust_64903", "text": "rust-1.38: bootstrap linker=clang: error: failed to run custom build command for `ryu v1.0.0` // Caused by: process didn't exit successfully: `.../work/rustc-1.38.0-src/build/bootstrap/debug/build/ryu-deb3460cf2bb47d1/build-script-build` (signal: 11, SIGSEGV [...] | ``` running: /tmp/portage/dev-lang/rust-1.38.0/work/rust-stage0/bin/cargo build --manifest-path /tmp/portage/dev-lang/rust-1.38.0/work/rustc-1.38.0-src/src/bootstrap/Cargo.toml --verbose --locked --frozen Compiling proc-macro2 v0.4.30 Compiling unicode-xid v0.1.0 Compiling syn v0 | labels: T-compiler, T-bootstrap, C-bug", "label": "high", "label_id": 1} {"id": "rust_64905", "text": "VecDeque constant time reverse? | The only way to reverse a `VecDeque` is to call `swap` to do an in-place reversal, which is O(n). My understanding is that `VecDeque` is implemented as a ring buffer which means we should be able to implement reverse in constant time with no element swaps by changing the directio | labels: A-collections, T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64908", "text": "ICE building Apache Arrow PR in `librustc_traits/normalize_erasing_regions.rs:42` | See https://travis-ci.org/apache/arrow/jobs/591264273 for failed build ``` error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:42: could not fully normalize `fn() -> usize {std::mem::size_of::<::Native>}` thread 'ru | labels: I-ICE, A-trait-system, regression-from-stable-to-nightly, A-associated-items, P-high, T-compiler", "label": "critical_bug", "label_id": 0} {"id": "rust_64915", "text": "have simpler diagnostic when passing arg to closure and missing borrow | playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9f1e00046f513d4d9da8790042e52ca9 Code: ````rust struct MyStruct { age: u32 } fn run bool>(func: F, data: &MyStruct) -> bool { func(&data) } fn main() { let m = MyStruct { age: | labels: C-enhancement, A-diagnostics, E-mentor, A-closures, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_64919", "text": "Suggested fix does not account for operator precedence | This fails (as expected): ``` fn foo() -> String { 1 + 2 } ``` However, the help message is wrong: ``` error[E0308]: mismatched types --> src/lib.rs:2:5 | 1 | fn foo() -> String { | ------ expected `std::string::String` because of return type 2 | 1 + 2 | ^^^^^ | | | expected stru | labels: E-easy, T-compiler, C-bug, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_64920", "text": "Can't return value from inside an if statement without return keyword | Minimal working example: ```rs fn test(recurse: bool) -> i32 { if recurse { // This should return value of `test(false)` from the function // Instead, it gives us an error that says \"expected (), found i32\" test(false) } 0 } fn main() { print!(\"{}\", test(true)); } ``` Error messa", "label": "medium", "label_id": 2} {"id": "rust_64926", "text": "Tracking issue for `const extern fn` and `const unsafe extern fn` | This is a tracking issue for implementing and stabilizing defining a `const extern fn` and `const unsafe extern fn` - [X] Add a test according to https://github.com/rust-lang/rust/pull/64906#issuecomment-539902772 (added in https://github.com/rust-lang/rust/pull/68370) ### Stabil | labels: A-FFI, T-lang, B-unstable, C-tracking-issue, A-const-eval, F-const_extern_fn", "label": "medium", "label_id": 2} {"id": "rust_64929", "text": "Provide more information about call stack in case of stack overflow during compilation | Compiling code with custom macros ``` RUST_BACKTRACE=full cargo build ``` results in ``` thread 'rustc' has overflowed its stack fatal runtime error: stack overflow error: could not compile `tests`. Caused by: process didn't exit successfully: `rustc --edition=2018 --crate-name t | labels: A-diagnostics, T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_64934", "text": "Unhelpful trait bound diagnostic hint for arbitrary self types | Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3d9fb14075d8fb9de8dea454fbb663e9

Code ``` #![feature(generator_trait)] use std::ops::{Generator, GeneratorState}; struct GeneratorIterator { generator: T, } impl i32 { a.saturating_add(b) } pub fn bar(a: i32, b: i32) -> i32 { match a.checked_add(b) { Some(v) => v, None => i32::max_value(), } } ``` But the | labels: C-enhancement, A-docs", "label": "low", "label_id": 3} {"id": "rust_64945", "text": "ICE: const eval error with an empty slice. | This code: ```rust pub struct Slice<'a, T>(&'a [T]); impl<'a, T: 'a> Slice<'a, T> { pub const EMPTY: Self = Slice ({ let v: &[T] = &[]; v }); } ``` Errors on `rustc 1.40.0-nightly (22bc9e1d9 2019-09-30) running on x86_64-unknown-linux-gnu` with this message: ``` Compiling playgro | labels: A-type-system, I-ICE, regression-from-stable-to-nightly, P-high, T-compiler, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_64947", "text": "Mixed signals from errors about trait const fns | I was trying to define a trait method as const, but it turned out in an error, which, according to [RFC911](https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md) is a design decision, and the [tracking issue for const fn](https://github.com/rust-lang/rust/issues/57 | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler, A-const-eval", "label": "low", "label_id": 3} {"id": "rust_64953", "text": "rustc panic on pattern matching when no unit type instance is specified | I forgot to add () inside Some(): ``` fn main() { match Some(()) { Some() => (), None => (), } } ``` Got panic: ``` $ RUST_BACKTRACE=full cargo build Compiling crash v0.1.0 (/tmp/crash) thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librust", "label": "medium", "label_id": 2} {"id": "rust_64957", "text": "tidy should skip RLS files | tidy should skip RLS files or even more, it should probably skip untracked files. ``` [santiago@galago rust1 (make-place-builder)]$ ./x.py test -i --stage 1 --keep-stage 1 src/tools/tidy Updating only changed submodules Submodules updated in 0.02 seconds Finished dev [unoptimized | labels: T-bootstrap, T-infra", "label": "question", "label_id": 4} {"id": "rust_64960", "text": "Cannot await in scope that contains call to format! | As part of #64477, it was identified that the following code no longer compiles (https://github.com/rust-lang/rust/issues/64477#issuecomment-531882958): ```rust async fn foo(_: String) { } fn bar() -> impl Send { async move { foo(format!(\"{}:{}\", 1, 2)).await; } } ``` This is as | labels: C-enhancement, T-lang, T-compiler, A-async-await, AsyncAwait-Triaged", "label": "low", "label_id": 3} {"id": "rust_64962", "text": "Crater runs for Rust 1.39.0 | cc @rust-lang/release | labels: S-waiting-on-review", "label": "medium", "label_id": 2} {"id": "rust_64964", "text": "ICE while compiling hyper (`StableHasher: unexpected region '_#0r`) | Hyper fails to compile on Rust master (702b45e40) ``` error: internal compiler error: src/librustc/ich/impls_ty.rs:100: StableHasher: unexpected region '_#0r ```
``` $ RUST_BACKTRACE=1 cargo +master check Checking hyper v0.13.0-alpha.2 (/home/manishearth/mozilla/Git/hyp | labels: I-ICE, regression-from-stable-to-nightly, T-compiler, C-bug, A-coroutines", "label": "critical_bug", "label_id": 0} {"id": "rust_64970", "text": "Const eval incorrectly computes that mutable param is zero | The following code results in a const eval divide by zero error, when it cannot actually error at runtime: ```rust pub fn foo(mut n: i32) { if n < 0i32 { n = 0i32 } if n > 0i32 { dbg!((1i32) / n); } } ``` https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ee | labels: T-compiler, C-bug, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_64976", "text": "The behaviour of `librustc_errors::Handler::reset_err_count` seems to contradict its documentation | The function: https://github.com/rust-lang/rust/blob/702b45e409495a41afcccbe87a251a692b0cefab/src/librustc_errors/lib.rs#L473 Citing the doc comment for this function: ```rust /// NOTE: *do not* call this function from rustc. It is only meant to be called from external /// tools ", "label": "medium", "label_id": 2} {"id": "rust_64985", "text": "ICE: StableHasher: unexpected region '_#0r | ``` error: internal compiler error: src/librustc/ich/impls_ty.rs:100: StableHasher: unexpected region '_#0r thread 'rustc' panicked at 'Box', src/librustc_errors/lib.rs:912:9 stack backtrace: 0: 0x7ff79606ba94 - backtrace::backtrace::libunwind::trace::had03042f494c8644 at /c", "label": "high", "label_id": 1} {"id": "rust_64988", "text": "Bad page rendering with js disabled | For example in here: https://docs.rs/slab/0.4.2/slab/struct.Slab.html No sections is shown because they're hidden by default. It should be overloaded with noscript so that they show by default in such case. | labels: T-rustdoc", "label": "low", "label_id": 3} {"id": "rust_64992", "text": "Tracking issue for unsizing casts in const fns | Right now we don't allow unsizing casts (array -> slice or type -> dyn Trait) in const fns on stable. While we can't allow unsizing to `dyn Trait` until we've figured out trait bounds in const fns, we can easily allow unsizing casts for slices, there's no reason not to have them. | labels: T-lang, B-unstable, C-tracking-issue, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_65000", "text": "FCP for toolstate changes | Manual FCP for this change. Please leave a comment if you can't tick the box due to lack of permissions or, preferably, ping me on Discord/Zulip (`@simulacrum`). The [PR](https://github.com/rust-lang/rust/pull/64977) has a more detailed explanation of this change, but the general | labels: T-bootstrap, disposition-merge", "label": "medium", "label_id": 2} {"id": "rust_65001", "text": "Regression in spacing of left margin in diagnostics | ```rust struct A; // // // // // // // fn main() { let _: () = A; let _: () = B; } ``` #### `$ cargo +nightly-2019-10-01 check` This is the correct output. ```console error[E0425]: cannot find value `B` in this scope --> src/main.rs:11:17 | 11 | let _: () = B; | ^ help: a unit st | labels: A-diagnostics, regression-from-stable-to-nightly, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_65005", "text": "Inconsistent `const_err` on index access to array in polymorphic functions | Stable currently allows indexing an array with invalid constant indices in polymorphic functions without warnings. A recently nightly change has apparently changed this behaviour into an error. The following builds on stable without warnings but errors on nightly: ```rust pub fn ", "label": "high", "label_id": 1} {"id": "rust_65006", "text": "`IndirectlyMutableLocals` analysis is unsound in the presence of unsafe code | #64470 added an `IndirectlyMutableLocals` analysis to track whether a local could possibly be mutated through a pointer at a given point in the program. However, this analysis overlooked the fact that a shared reference to a `Freeze` field of a struct could be converted to a shar | labels: T-compiler, I-unsound, C-bug, A-const-eval", "label": "critical_bug", "label_id": 0} {"id": "rust_65008", "text": "Entire program seems to be optimized away | I've come across a situation where the presence or absence of a comment changes the program behavior. With the comment present, the program does exactly what I expect (prints a bunch of stuff). Without the comment, the program does nothing and terminates with exit code 0. I have | labels: T-compiler, regression-from-stable-to-stable, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_65014", "text": "Updating Cargo.lock can result in dependency cycle | Bumping few packages can result in dependency cycle. Single command reproducer: ``` $ cargo update --aggressive -p cargo Updating crates.io index Updating git repository `https://github.com/rust-lang/cargo` error: cyclic package dependency: package `compiler_builtins v0.1.19` dep", "label": "medium", "label_id": 2} {"id": "rust_65015", "text": "Point at duplicated dot in method access | [The following incorrect code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=afabf424606627e723a6faed1bcde8e9) ```rust struct Type { option: Option> } impl Type { fn method(&self) -> Option> { self.option..as_ref().map(|x| x) } } fn main | labels: C-enhancement, A-diagnostics, P-low, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65017", "text": "Internal Compiler Error When Making Requests With Hyper | I've been staring at this error all day long and finally decided to file a report for it, so here we are. I'm attempting to make a request using identical code to the [hyper client.rs example](https://github.com/hyperium/hyper/blob/master/examples/client.rs), but I continue to ge", "label": "high", "label_id": 1} {"id": "rust_65022", "text": "Possible beta to nightly regression (from | Possible regression from beta-1.39 to nightly-1.40, exposed by [`tonic`](https://github.com/hyperium/tonic) I tried this code (using the [rust nix overlay](https://github.com/mozilla/nixpkgs-mozilla/blob/master/rust-overlay.nix)): ``` $ cd tonic $ nix-shell -p latest.rustChannels", "label": "high", "label_id": 1} {"id": "rust_65023", "text": "error: unused attribute const_fn_union with incr-comp | Every time I try to recompile the compiler using incremental compilation with `./x.py build -i --stage 1 --keep-stage 1 src/libstd` I get the following error ... ``` error: unused attribute --> src/libcore/slice/mod.rs:66:5 | 66 | #[allow_internal_unstable(const_fn_union)] | ^^^^ | labels: T-compiler, A-incr-comp, C-bug, WG-incr-comp, A-const-eval", "label": "medium", "label_id": 2} {"id": "rust_65024", "text": "Allow building for hard-float targets in RISC-V | Currently Rust does not support compiling/linking with LLVM's `-target-abi=lp64d` option, which enables the hard-float ABI in riscv64. This feature is necessary for Rust interop with C code on hard-float targets. | labels: A-cross, T-compiler, C-feature-request, O-riscv", "label": "question", "label_id": 4} {"id": "rust_65025", "text": "type parameter `A/#0` (A/0) out of range when substituting (root type=Some(*const A)) substs=[] | Minimal example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=814876c654b0b3ad162d52ba64064b02 ``` error: internal compiler error: src/librustc/ty/subst.rs:557: type parameter `A/#0` (A/0) out of range when substituting (root type=Some(*const A)) substs | labels: A-type-system, I-ICE, A-FFI, P-medium, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_65028", "text": "regression in 2019-10-01 nightly | I will try to make a reproduction later, but just wanted to open an issue now. The code worked when compiling with the beta and the prior nightly. ``` error: internal compiler error: src/librustc/ich/impls_ty.rs:100: StableHasher: unexpected region '_#0r thread 'rustc' panicked a", "label": "high", "label_id": 1} {"id": "rust_65029", "text": "libsyntax JSON output bytes counts ignore CRLF normalization | Recently there was a change in rustc to normalize newlines (CRLF -> LF) early during processing (#62948). This caused a change in the JSON output offsets. While the line/column values were unaffected (since they do not include the newlines in the counts), the `byte_start`/`byte_e | labels: A-parser, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_65033", "text": "An ICE when awaiting an async method. | I tried this code: ```rust struct Struct; async fn a() { Struct.method().await; } impl Struct { async fn method(&self) {} } ``` ## Meta `rustc --version --verbose`: ``` rustc 1.40.0-nightly (702b45e40 2019-10-01) binary: rustc commit-hash: 702b45e409495a41afcccbe87a251a692b0cefab", "label": "high", "label_id": 1} {"id": "rust_65034", "text": "`SocketAddr{V4,V6}` or `Ip{V4,V6}Addr` should have `ANY`/`any` constructor | A commonplace difference between Windows and other targets is that to bind to \"all\" interfaces, you need to use `LOCALHOST` on Windows and `UNSPECIFIED` everywhere else. We should make this easy via e.g. associated methods like these: ``` SocketAddrV4::any(port) SocketAddrV6::any | labels: T-libs-api, C-feature-request", "label": "low", "label_id": 3} {"id": "rust_65035", "text": "ICE: src/librustc_lint/types.rs:858: unexpected type in foreign function: T | ```rust fn _f() { extern \"C\" { static _a: *const T; } } ``` backtrace: ``` Compiling playground v0.0.1 (/playground) error: internal compiler error: src/librustc_lint/types.rs:858: unexpected type in foreign function: T thread 'rustc' panicked at 'Box', src/librustc_error | labels: A-lints, I-ICE, A-FFI, P-medium, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_65036", "text": "Intermittent failure in src/test/ui/reify-intrinsic.stderr | The test `src/test/ui/reify-intrinsic.stderr` appears to be intermittently changing its output. Usually, it prints: `unsafe extern \"rust-intrinsic\" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` but sometimes it prints: `unsafe extern \"rust-intrinsic\" fn(_) -> _ {std::mem::tran | labels: A-pretty, A-resolve, T-compiler, C-bug, A-reproducibility", "label": "medium", "label_id": 2} {"id": "rust_65041", "text": "an empty `:vis` doesn't work in trait declaration | I want to create a macro that generate `fn`s that use in both `impl Item...` and `trait TraitName`. In `trait`, `pub` must be omitted, but in `impl SomeStruct` I need `pub`, so the macro need a `$vis:vis` like this: ```rust macro_rules! create_method { ($vis:vis $name:ident) => { | labels: A-parser, A-visibility, A-macros, T-lang, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_65044", "text": "restrict type parameter `Self` error is unclear. | The following example code yields an error: ``` struct Demo { a: String } trait GetString { fn get_a(&self) -> &String; } trait UseString { fn use_string(&self) { println!(\"{:?}\", self.get_a()); } } impl GetString for Demo { fn get_a(&self) -> &String { &self.a } } impl UseString | labels: A-diagnostics, T-compiler, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2} {"id": "rust_65047", "text": "UI Tests that check ICEing thread names break with `parallel-compiler = true` | When I run `./x.py test` locally on a clean checkout of master with `parallel-compiler = true`, I see a couple of failures that seem to be related to the name of the rustc thread which ICEd in the tests. I turned parallel-compiler off, reran the test command, and the tests passed | labels: E-easy, I-ICE, P-high, T-compiler, C-bug, A-parallel-compiler", "label": "high", "label_id": 1} {"id": "rust_65049", "text": "Tracking issue for `Span::mixed_site` | This is a tracking issue for `Span::mixed_site` API providing direct access to `macro_rules` hygiene to proc macros. Introduced in https://github.com/rust-lang/rust/pull/64690. | labels: A-macros, T-lang, T-libs-api, B-unstable, C-tracking-issue", "label": "medium", "label_id": 2} {"id": "rust_65051", "text": "Build with pure LLVM toolchain on Linux | Hello, I'm creating a Linux distribution that does not use GCC and use LLVM/Clang and their libraries by default (libc++, libc++abi, compiler-rt and libunwind). No libstdc++ or gcc installed. The distribution is based on musl as well. I'd like to build rust with that pure LLVM to | labels: A-LLVM, T-bootstrap, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_65058", "text": "Type Inference issue with Option> | My current project uses a wrapper struct that wraps every occuring error in a struct that has a field of the type Option>. During implementation of the From<*> traits I encountered the issue shown in the picture: ![Screenshot 2019-10-02 at 20 12 35](htt", "label": "medium", "label_id": 2} {"id": "rust_65059", "text": "line num capped to 2 digits in errors | ``` error[E0282]: type annotations needed for `std::result::Result<(), E>` --> sysroot_src/src/libtest/lib.rs:1627:42 | 16| let result = Ok(testfn()); | ------ consider giving `result` the explicit type `std::result::Result<(), E>`, with the type parameters specified ... 16| Err( | labels: A-frontend, A-diagnostics, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_65060", "text": "`incremental = true` as the default in config.toml? | I'm curious whether it would make sense for `incremental = true` to be the default for rustbuild in the absence of another setting. Per @eddyb on IRC: ``` 07:53 it used to be bad for a bit until a few months ago (that is, it would produce a very slow compiler) but nowaday | labels: C-enhancement, A-incr-comp, T-bootstrap, T-infra", "label": "low", "label_id": 3} {"id": "rust_65061", "text": "x86_64-unknown-linux-musl: bad linker for target and unknown __fprintf_chk symbol | I'm trying to build a static musl target from source. I'm using the source release for 1.38.0. Here's the build config for `x.py`: ``` configure: build.rustc := /nix/store/31dk8a6ai75pgf19irr360qakqcx898m-ru ... configure: build.cargo := /nix/store/w3prpvk1rmw24lhci2kpc0xn9rmzf7z | labels: A-linkage, T-compiler, T-bootstrap, T-infra, O-musl, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65062", "text": "Suggest &mut T for &T and vice versa for missing trait bound if applicable | As seen on [Twitter](https://twitter.com/khyperia/status/1179518655790374912?s=19): Missing trait does not hint (im)mutable reborrowing, at least in that specific case. | labels: C-enhancement, A-diagnostics, A-trait-system, T-compiler, A-suggestion-diagnostics", "label": "low", "label_id": 3} {"id": "rust_65063", "text": "Port rust python scripts to python3 | Since python2 support will stop at the end of the year, I think it's time to move on. Will send the PR tomorrow. | labels: C-cleanup, T-bootstrap, T-infra", "label": "question", "label_id": 4} {"id": "rust_65065", "text": "Error while building rustc on Windows MSVC (cl.exe returns 2) | Building with x.py on Windows, I already have Rust working thru rustup, but I wanted to build a patched rustc. However this error comes before stage1 begins and is related to cl.exe not compiling something I haven't touched; I made sure to update all the submodules with git and s | labels: A-LLVM, O-windows-msvc, T-bootstrap", "label": "medium", "label_id": 2} {"id": "rust_65071", "text": "`x.py test` generates several `dot` files in the source directory root | ``` definite_init_indirect.dot maybe_init_indirect.dot maybe_uninit_indirect.dot mut_borrowed_locals_indirect.dot ``` If they are necessary, then they should be generated somewhere inside the build directory. cc @ecstatic-morse | labels: T-compiler, T-bootstrap, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65079", "text": "unboxed_closures syntax is not consistent | https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=02e56c54b3189d4098e6dc06550461e5 ```rust #![feature(unboxed_closures)] trait A: FnMut { } impl> A for T {} trait B {} fn a() -> Box ()> { // <- this works! B", "label": "medium", "label_id": 2} {"id": "rust_65080", "text": "TokenStream manipulations are 1000x too slow | Context: https://github.com/illicitonion/num_enum/pull/14 Switching a proc macro from being token-based to operating on strings with just a final conversion from string to TokenStream can be a 100x improvement in compile time. If we care that people continue to write macros using | labels: C-enhancement, I-compiletime, A-macros, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65084", "text": "`rls` no longer builds after rust-lang/rust#65076 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#65076, I observed that the tool rls no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rls is needed to fix the fallout. cc @tmandry, do you think you would have time | labels: P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_65085", "text": "`rustfmt` no longer builds after rust-lang/rust#65076 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#65076, I observed that the tool rustfmt no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rustfmt is needed to fix the fallout. cc @tmandry, do you think you would ha | labels: P-high, T-compiler", "label": "high", "label_id": 1} {"id": "rust_65086", "text": "Ephemeral borrow on a RefCell that extracts a Copy struct member in func argument position does not drop the borrow before making the funcall | Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=be4dfa9fda3dbe2c8ccb42c3785bd658 This code panics and I do not think it should. ```rust use std::cell::RefCell; use std::rc::Rc; #[derive(Clone, Copy)] struct Item(u32); #[derive(Clone)] struct In", "label": "medium", "label_id": 2} {"id": "rust_65088", "text": "Add support for `-Ztimings` to `x.py` | Cargo's new experimental `-Ztimings` flag is really cool. See [here](https://gistpreview.github.io/?74d799739504232991c49607d5ce748a) for sample output. It would be great to add support for this to `x.py`. It would help a lot with #65031. I tried and failed to get `-Ztimings` wor | labels: T-compiler, T-bootstrap, T-cargo, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_65090", "text": "Star Import Precedence Regression in Beta | The goblin tests started failing in beta because there seem to be a change in order for how star imports are applied. This PR changes the imports so nothing shadows any more: https://github.com/m4b/goblin/pull/184 Annoyingly I cannot produce an isolated test case that shows this | labels: A-resolve, P-medium, T-compiler, regression-from-stable-to-beta, C-bug, E-needs-bisection", "label": "critical_bug", "label_id": 0} {"id": "rust_65093", "text": "Is panic message stabilized? | Can I parse output from a program \"**thread** 'main' **panicked at** '**called** `Result::unwrap()` on an `Err` value: ()\" to detect what panic has occurred?", "label": "medium", "label_id": 2} {"id": "rust_65096", "text": "`clippy-driver` no longer builds after rust-lang/rust#65087 | Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust#65087, I observed that the tool clippy-driver no longer builds. A follow-up PR to the repository https://github.com/rust-lang/rust-clippy is needed to fix the fallout. cc @Centril, do you think yo | labels: T-compiler", "label": "medium", "label_id": 2} {"id": "rust_65108", "text": "ptr::offset should explicitly clarify 0-sized offset semantics | https://doc.rust-lang.org/std/primitive.pointer.html#method.offset I can't remember the past arguments we definitely had about this, but it would be nice to explicitly call out the answer in the docs. As a relevant example, Vec::into_iter currently unconditionally computes the \"e | labels: C-enhancement, T-lang, T-libs-api, A-docs", "label": "question", "label_id": 4} {"id": "rust_65114", "text": "Invalid identifier in proc_macro causes ICE | lib.proc-macro: ```rust #[proc_macro] pub fn foo( item: proc_macro::TokenStream, ) -> proc_macro::TokenStream { let ident = Ident::new(\"?\", Span::call_site()); item } ``` bin: ```rust foo!{} ``` build: ``` thread 'rustc' panicked at '`\"?\"` is not a valid identifier', src\\libsynta", "label": "high", "label_id": 1} {"id": "rust_65119", "text": "Compiling a file with a non-ASCII name with `--error-format=short` enabled makes error messages contain excessive spaces after \"filename:line:column\" | Consider the following rust source (in `test.rs`): ```rust fn main() { println!(\"hello world } ``` It is obvious that it has syntax error. It also seems obvious that the generated error shouldn't depend on name of file except noting the name of file. However, it doesn't happen in | labels: A-diagnostics, A-Unicode, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65122", "text": "ICE: macro expansion using `expr` fragment as identifier | Regression from stable to nightly ```rust macro_rules! mac { ($eval:expr) => { let mut $eval = (); }; } fn foo() { mac! { does_not_exist!() } } ``` backtrace ``` thread 'rustc' panicked at 'visit_mac disabled by default', src/libsyntax/mut_visit.rs:210:9 stack backtrace: 0: backt | labels: A-diagnostics, I-ICE, A-parser, A-macros, T-compiler, regression-from-stable-to-beta", "label": "critical_bug", "label_id": 0} {"id": "rust_65127", "text": "Many is_ascii_ methods are slower than they have to be | I noticed this `is_ascii` check: https://github.com/rust-lang/rust/blob/618768492f0c731fcb770dc2d178abe840846419/src/libcore/char/methods.rs#L1078 and wondered why it's there. Then someone told me it's there because of the `as u8`. If you pass a non-ASCII char, the `as u8` would | labels: I-slow, C-enhancement, T-libs-api", "label": "question", "label_id": 4} {"id": "rust_65128", "text": "link_section attribute misleadingly allowed on modules and impls | The `#[link_section]` attribute seems to be allowed on modules and impl blocks, but it will not do anything. I would expect either all functions/statics within the module/impl to be placed into the specified link_section, but this does not happen. Code used: ``` #[link_section = | labels: A-linkage, A-attributes, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65131", "text": "Middle size, 80 000 lines, project but very slow, 5 hours, compilation | This code is the [MAVLink ](https://mavlink.io/en/) protocol handler, and generated by one of the MAVLink specification. It is **C/Rust** mixed project, so to compile it you will need **Rust** , **CC** an any **C** compiler. To check how slow **rustc** is, [check this out ](https | labels: E-needs-test, I-compiletime, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65132", "text": "VecDeque: add with_exact_capacity | I've tried this code: ```rust let vd = VecDeque::with_capacity(1024); dbg!(vd.capacity()); ``` The observed behavior is `vd.capacity() = 2047` It would be great if there was a call like `fn with_exact_capacity(capacity: usize) -> Result, ()>` that would return a `V | labels: A-collections, T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_65138", "text": "SIGSEGV in LLVM | I was trying to compile some x86 early boot code and encountered a SIGSEGV in LLVM: ``` * thread #4, stop reason = EXC_BAD_ACCESS (code=1, address=0x18) * frame #0: 0x00000001061cca13 librustc_codegen_llvm-llvm.dylib`(anonymous namespace)::MachineLICMBase::IsLoopInvariantInst(llv | labels: I-crash, A-LLVM, T-compiler, C-bug", "label": "high", "label_id": 1} {"id": "rust_65147", "text": "check_mod_item_types query times regressed bigly | There is a crate inside of Fuchsia whose compile times increased from ~500ms to ~120s in the last month of Rust compiler updates. It hasn't been easy so far to provide a minimal example, but I will keep working at it. Some bisecting revealed that it actually consisted of two perf | labels: I-compiletime, P-high, T-compiler, regression-from-stable-to-beta, C-bug, A-async-await", "label": "critical_bug", "label_id": 0} {"id": "rust_65148", "text": "rustfix: Autofix try! macro in edition lint to use `?` operator | Now `try!` macro has been deprecated in #62672. I think it's time to automatically fix `try!(expr)` to `expr?` in edition lint. | labels: A-lints, A-diagnostics, T-lang, C-feature-request, A-suggestion-diagnostics, A-edition-2018", "label": "medium", "label_id": 2} {"id": "rust_65149", "text": "Trait bound is ignored | I have a simple program below that is trying to call `poll_next` on a `T: Stream`. The compiler seems to ignore the trait bound, and suggests adding the exact trait bound that is already in use. This is using the current **beta** rust version: `rustc 1.39.0-beta.5 (fa5c2f3e5 2019 | labels: A-diagnostics, A-trait-system, T-compiler, C-bug, F-arbitrary_self_types, D-confusing", "label": "medium", "label_id": 2} {"id": "rust_65157", "text": "#[non_exhaustive] variants are not detected to be redundant | Say I have the following enum in crate `b`: ```rust #![feature(non_exhaustive)] pub enum Enum { Unit, #[non_exhaustive] Struct { x: bool } } ``` And I match on it in crate `a`: ```rust #![deny(unreachable_patterns)] match Enum::Unit { Enum::Struct { .. } => {} Enum::Struct { .. } | labels: T-compiler, C-bug, requires-nightly, F-non_exhaustive", "label": "medium", "label_id": 2} {"id": "rust_65159", "text": "Nightly async fn ICE | The following ICE's in nightly: ```Rust async fn copy() -> Result<()> { Ok(()) } ```
Backtrace: ``` Compiling playground v0.0.1 (/playground) error[E0107]: wrong number of type arguments: expected 2, found 1 --> src/lib.rs:1:20 | 1 | async fn copy() - | labels: I-ICE, T-compiler, C-bug, A-async-await, AsyncAwait-Polish, AsyncAwait-Triaged", "label": "high", "label_id": 1} {"id": "rust_65163", "text": "Implement std::iter::FromIterator for Box | This would allow to construct a Box from an iterator, example: ```let string: Box = (0..5).map(|_| '☺').collect();``` This issue has been assigned to @Duddino via [this comment](https://github.com/rust-lang/rust/i | labels: A-collections, T-libs-api, C-feature-request", "label": "medium", "label_id": 2} {"id": "rust_65171", "text": "rustdoc fails to account for `-Clinker` and `-Clink-arg` when building tests | I’m working on a fairly peculiar system at the moment where the default linker (`cc`) is not able of linking properly, and thus I set the following environment variables ``` export RUSTFLAGS=\"-Clinker=clang -Clink-arg=--target=$HOST_TARGET\" export RUSTDOCFLAGS=\"-Clinker=clang -Cl | labels: A-linkage, T-rustdoc, C-bug, A-doctests", "label": "medium", "label_id": 2} {"id": "rust_65180", "text": "Async-related type error messages defy expectations (in span location) | Consider for example this code (using `hyper-0.13.0`): ```rust use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, TcpListener}; #[derive(failure::Fail, Debug)] enum Error { #[fail(display=\"Cannot bind to port {}\", _1)] CannotBind(#[cause] std::io::Error, u | labels: A-diagnostics, T-compiler, C-bug, A-async-await, AsyncAwait-Polish, AsyncAwait-Triaged", "label": "medium", "label_id": 2} {"id": "rust_65183", "text": "`fetch_add` in atomic integers won't check for overflow | Since the default Rust semantics is to check for overflows in debug, maybe `fetch_add` and `fetch_sub` should check for overflows (in debug), and we should provide `fetch_wrapping_add` and `fetch_wrapping_sub`? Or, if we don't want to introduce breaking changes, we should at leas | labels: C-enhancement, T-libs-api, A-docs", "label": "low", "label_id": 3} {"id": "rust_65184", "text": "ICE: thread 'rustc' panicked at 'Box' | This occurred when running `cargo clippy` on a workspace with around 40 child crates. I have not included the full log, for corporate security reasons, but I can probably provide more specific information on request. ``` ... Checking tokio-tcp v0.1.3 Checking tokio-udp v0.1.3 Che | labels: I-ICE, T-compiler, T-dev-tools, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_65189", "text": "deprecated proc_macro trigger warning on build library | Use `deprecated` attribute on a procedural macro function doesn't work like expected: it triggers a warning message also when library is building and not just in call place. I know that the `deprecate` attribute support is not landed in stable but this warning is present in all c | labels: E-easy, A-lints, E-mentor, A-macros, T-compiler, C-bug", "label": "question", "label_id": 4} {"id": "rust_65204", "text": "DWARF for legacy enum incorrect | With test-case gdb.rust/simple.exp (https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/testsuite/gdb.rust/simple.rs;hb=HEAD) we run into gdb testsuite failure reported here ( https://sourceware.org/bugzilla/show_bug.cgi?id=25048 ). This is on openSUSE Leap 15.1 | labels: A-debuginfo, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65207", "text": "Change in macro output between 1.37.0 and 1.38.0 | The following code changed output between Rust 1.37.0 and 1.38.0: ```rust macro_rules! call_a_or_b_on_tail { ((a: $a:expr, b: $b:expr), call a: $($tail:tt)*) => { $a(stringify!($($tail)*)) }; ((a: $a:expr, b: $b:expr), call b: $($tail:tt)*) => { $b(stringify!($($tail)*)) }; ($ab:", "label": "medium", "label_id": 2} {"id": "rust_65211", "text": "Provide a way to disable rustdoc keyboard shortcuts | Some people have custom OS or browser-level shortcuts, providing a way to disable these makes it easier for them | labels: T-rustdoc", "label": "medium", "label_id": 2} {"id": "rust_65212", "text": "Potentially swap arrow keys and tab in rustdoc keyboard shortcuts | Currently rustdoc's keyboard shortcuts use Tab to cycle between the tabs at the top of search results, and the arrow keys for moving through search results. It's much more common for Tab and Shift + Tab | labels: T-rustdoc, A-rustdoc-ui, A-rustdoc-search", "label": "question", "label_id": 4} {"id": "rust_65224", "text": "Occasional spurious codegen test failures | Occasionally when running tests, I get these failures: ``` [codegen] codegen/issue-45222.rs [codegen] codegen/issue-45466.rs [codegen] codegen/swap-small-types.rs [codegen] codegen/vec-iter-collect-len.rs [codegen] codegen/vec-optimizes-away.rs ``` My current workaround is to del | labels: A-testsuite, T-compiler, A-spurious, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65225", "text": "Tracking issue for `#![feature(entry_insert)]` | This is a tracking issue for the `Entry::insert_entry` method on HashMap and BTreeMap introduced in https://github.com/rust-lang/rust/pull/60142#issuecomment-487416553. - [x] Implementation for HashMap: #64656 - [x] ~~Stabilised in 1.59: #90345~~ Re-stabilised in 1.83: #130290 - | labels: A-collections, T-libs-api, B-unstable, C-tracking-issue, disposition-merge, finished-final-comment-period", "label": "medium", "label_id": 2} {"id": "rust_65230", "text": "Compiler should not omit associated type in compile error message | ## Environment - Rust: Nightly 2019-10-07 ## Repro 1. Open https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=933123bb14852662962ab5bf5f2073c8 2. Click run ```rust struct X<'a>(&'a mut i32); impl<'a> Iterator for X<'a> { type Item = &'a i32; fn next(&mut sel | labels: A-diagnostics, T-compiler, C-bug, D-confusing", "label": "medium", "label_id": 2} {"id": "rust_65231", "text": "DebugMap::finish panics if a value returns fmt::Error | ```rust use std::fmt; struct ErrorFmt; impl fmt::Debug for ErrorFmt { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { Err(fmt::Error) } } struct A { field: ErrorFmt, } impl fmt::Debug for A { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_map() .entry(&\"fie | labels: T-libs-api, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65233", "text": "Internal lint: Ban `pub` re-exports | Suggested lint name: `rustc::pub_reexport`. When given something like the following, reject it (as a lint): ```rust pub use syntax_pos::symbol; ``` cc https://github.com/rust-lang/rust/issues/49509 -------------------------- Me and @Mark-Simulacrum were discussing library-ificati | labels: C-enhancement, A-lints, T-compiler, T-bootstrap", "label": "low", "label_id": 3} {"id": "rust_65238", "text": "Don't cc rust-lang/compiler for toolstate changes | While it's important to keep on top of regressions to the toolstate, most of the time these issues are fixed quickly, by the author of the PR that caused the regression, or someone else. With GitHub notifications being difficult enough to keep up with as it is, being mentioned on | labels: E-easy, C-enhancement, T-compiler, T-infra, T-dev-tools", "label": "high", "label_id": 1} {"id": "rust_65257", "text": "Use 'mut' as alias for 'let mut' | The idea of shortening `let mut` to `var` has been discussed many times before, and the general consensus always ends up being that it is not a good idea. I would like to propose something a bit different, so please hear me out. I propose that instead of aliasing `var` to `let mu | labels: E-easy, C-enhancement, A-diagnostics, P-medium, E-mentor, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65245", "text": "f32::NAN as i128 different between miri and LLVM | ``` fn main() { let f = std::f32::NAN; assert_eq!(f as i128, 0x7fffffffffffffffffffffffffffffffi128); // LLVM assert_eq!(std::f32::NAN as i128, 0i128); // miri } ```", "label": "medium", "label_id": 2} {"id": "rust_65247", "text": "Confusing error message when trying to implement From> for Option | I have a local type: ```rust #[derive(Debug, Deserialize)] #[serde(untagged)] enum BadOption { Some(T), None(Value), } ``` and I want to `impl From> for Option` but the error message suggests that `T` isn't being used as the type parameter for a local type > | labels: C-enhancement, A-diagnostics, T-compiler, D-confusing", "label": "low", "label_id": 3} {"id": "rust_65253", "text": "Internal compiler error: can't buffer lints after HIR lowering | Hi there, I'm updating rust-sgx-sdk (solving rust-sgx-sdk [#161](https://github.com/baidu/rust-sgx-sdk/issues/161)) to use latest rust nightly compiler to help the error info more ergonomic by the help of #60561. However, the compiler always panics. Your help would be very much h | labels: I-ICE, T-compiler, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_65254", "text": "Confusing error now saying `let` (not `if let`) is an expression, rather than a statement, which contradicts the book | cc @Centril Code first. This code: ``` fn main() { let x = (let y = 6); } ``` [on current stable Rust 1.38](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=db087215a59f29b6c19440c89ddb2484), gives this set of error messages: ``` error[E0658]: `let` express | labels: E-easy, A-diagnostics, E-mentor, T-compiler, E-help-wanted, D-confusing", "label": "question", "label_id": 4} {"id": "rust_65259", "text": "Cleanup: Deduplicate implementations of `is_{freeze,copy,sized}_raw` | See: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc/ty/util.rs.html#1045 This issue has been assigned to @mbStavola via [this comment](https://github.com/rust-lang/rust/issues/65259#issuecomment-540370893). src/main.rs:3:9 | 3 | 'label: for _ in 0..1 { | ^^^^^^ | | | fir | labels: A-lints, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65270", "text": "compiler fails to understand generics | The following code won't simply compile. Is this an intended behavior? ```rust trait Finite { const MAX_CASE: usize; fn identifier(&self) -> usize; } pub struct Array([U; T::MAX_CASE]); ``` minimized code replicating error ```rust trait A { const M: usize; } struct ", "label": "medium", "label_id": 2} {"id": "rust_65271", "text": "src/librustc_codegen_ssa/callee.rs is redundant | Per @eddyb, this file contains wrappers which don't do much. It seems like they should perhaps be inlined and the module deleted? | labels: C-cleanup, A-codegen, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65272", "text": "GDB cast raw pointer to &str | The `&str` type is not available in `rust-gdb`. When debugging using `rust-gdb`, local variables with `&str` type are pretty printed. ``` (gdb) p my_string_local $6 = \"my string\" (gdb) ptype my_string_local type = struct &str { data_ptr: *mut u8, length: usize, } ``` I expect tha | labels: A-debuginfo, P-medium, T-compiler", "label": "medium", "label_id": 2} {"id": "rust_65275", "text": "request: Make `unix::net::SocketAddr` create methods public | ## Motivation Recently [tokio-rs/mio](https://github.com/tokio-rs/mio/) needed support for creating the `std::os::unix::net::SocketAddr` type. While the type is currently public, it is not possible to create one as both creation methods are private: * [SocketAddr::new](https://gi | labels: T-libs-api, C-feature-request", "label": "question", "label_id": 4} {"id": "rust_65279", "text": "Inconsistent auto-reborrowing behavior of generic functions | Look at this piece of code: ```rust fn f(x: T, y: T) {} fn main() { let x = &mut 0i32; let y = &mut 1i32; f(x, y); let z = &mut *y; println!(\"{} {} {}\", x, y, z); } ``` From the internet, I get the impression that generic functions will not auto-reborrow if the type of paramet", "label": "medium", "label_id": 2} {"id": "rust_65282", "text": "atomic::Ordering \"same as LLVM's\"? Seems wrong. | @jonas-schievink [pointed out](https://github.com/rust-lang/rust/issues/32976#issuecomment-540777070) that our `atomic::Ordering` docs say > Rust's memory orderings are the same as LLVM's. That's not really correct though... at least according to the Nomicon, we [use the C11 memo | labels: A-LLVM, T-lang, A-docs, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_65284", "text": "E0599 error message may suggest syntactically invalid fix | [Full code in Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3b1a6a68ae4db990762e4a542fbf052a) Missing a trait bound for the trait that defines `fn foo` below: ```rust fn do_stuff(t : T) { // Note the space before the colon in `T : Ba | labels: T-compiler, C-bug, A-suggestion-diagnostics, D-invalid-suggestion", "label": "medium", "label_id": 2} {"id": "rust_65285", "text": "Incorrect \"explicit lifetime name needed\" error | ```rust struct Nested(K); trait X<'a, K: 'a> { fn foo<'b, L: X<&'b Nested>>(); } ``` produces: ``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> src/lib.rs:4:19 | 4 | fn foo<'b, L: X<&'b Nested>>(); | ^^^^^^^^^^^^^^^^ explicit lifetime name | labels: A-diagnostics, A-lifetimes, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65286", "text": "\"Consider adding an explicit lifetime bound\" doesn't take into account existing bounds | ```rust trait X { fn foo(&self) {} } fn p3<'a, 'b, T: 'b>(v: T) -> Box where T: X { Box::new(v) } ``` produces: ``` error[E0309]: the parameter type `T` may not live long enough --> src/lib.rs:4:5 | 3 | fn p3<'a, 'b, T: 'b>(v: T) -> Box where T: X { | -- h | labels: A-diagnostics, T-compiler, C-bug, A-suggestion-diagnostics", "label": "medium", "label_id": 2} {"id": "rust_65287", "text": "Lifetimes are inconsistently printed with backticks | ```rust fn foo<'a>(u: &'a usize) -> impl IntoIterator + 'a { std::thread::spawn(|| { println!(\"{}\", u); }); vec![] } ``` displays: ``` error: cannot infer an appropriate lifetime --> src/lib.rs:2:24 | 2 | std::thread::spawn(|| { | _____------------------_^ | | | | | | labels: E-easy, A-diagnostics, T-compiler, D-inconsistent", "label": "low", "label_id": 3} {"id": "rust_65290", "text": "RISC-V: Inline assembly ecall assumes return value in incorrect register | The following 32-bit RISC-V Rust code ```rust pub unsafe fn allow_ptr(major: usize, minor: usize, slice: *mut u8, len: usize) -> isize { let res; asm!(\"li a0, 3 ecall\" : \"=r\" (res) : \"{x11}\" (major), \"{x12}\" (minor), \"{x13}\" (slice), \"{x14}\" (len) : \"memory\" : \"volatile\"); res } | labels: A-inline-assembly", "label": "medium", "label_id": 2} {"id": "rust_65291", "text": "compiler error building arrow on rustc 1.40.0-nightly on mac | ```$ ~/code/example cargo build Compiling arrow v0.15.0 error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:42: could not fully normalize `fn() -> usize {std::mem::size_of::<::Native>}` thread 'rustc' panicked at 'B | labels: I-ICE, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_65296", "text": "Rust platform size (round 2) | Reopening this issue as its not fixed. On my last post in July the size was 294 MB: https://github.com/rust-lang/rust/issues/61978#issuecomment-509259209 comically, its actually larger now at 347 MB: https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.msi | labels: C-enhancement, T-compiler, I-heavy", "label": "low", "label_id": 3} {"id": "rust_65300", "text": "`rustc_data_structures::static_assert!(false)` does not error | `1.40.0-nightly 2019-10-09 20cc75272619cc452e3a` The following does not error locally / on the playground https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9dde03338a31e2f40491a66dc3a18761 ```rust #![feature(rustc_private)] extern crate rustc_data_structure | labels: T-compiler, C-bug", "label": "low", "label_id": 3} {"id": "rust_65303", "text": "Refactor: deduplicate \"can this unwind?\" logic | Currently, we have two separate codepaths to decide if a function needs an abort-on-panic shim and if it gets the `nounwind` attribute. This risks them getting out of sync -- and indeed they are out-of-sync right now, but there's lots of opposition to fix that critical bug, so I | labels: C-cleanup, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65304", "text": "also read cargo.toml | https://doc.rust-lang.org/cargo/faq.html#why-cargotoml ## \"Sorting files often puts capital letters before lowercase letters\" could you please provide your analysis on how you count \"often\"? cause its not with coreutils 8.31, `ls`: ``` $> touch foo Foo bar Bar $> \\ls bar Bar foo ", "label": "medium", "label_id": 2} {"id": "rust_65306", "text": "`cargo check`-invoked Rustc 10x slower since `nightly-2019-10-03` | Starting `nightly-2019-10-03`, Rustc ~~**hangs forever**~~ is about 10x slower while building my project (Linux x86-64). It works fine on `nightly-2019-10-01` and earlier versions. In between, `nightly-2019-10-02` has an ICE. I am only invoking `cargo check`. See below for the IC | labels: T-compiler, C-bug, I-hang, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_65309", "text": "performance of saturating_mul can be improved by removing branches | While playing with `saturating_mul` to see if it can be made branchless and thus a const fn (sorry @RalfJung ;) ), I found that the performance of signed `saturating_mul` can actually be improved. I tested two implementations: 1. ```rust pub fn saturating_mul(a: i32, b: i32) -> i | labels: A-LLVM, I-slow, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65313", "text": "aarch64 windows backend forces panic=abort | The [aarch64-pc-windows-msvc](https://github.com/rust-lang/rust/blob/master/src/librustc_target/spec/aarch64_pc_windows_msvc.rs#L8) and [aarch64-uwp-windows-msvc](https://github.com/rust-lang/rust/blob/master/src/librustc_target/spec/aarch64_pc_windows_msvc.rs#L8) targets force p | labels: A-runtime, C-enhancement, O-Arm, T-compiler, O-windows-msvc", "label": "question", "label_id": 4} {"id": "rust_65317", "text": "Spurious `...` at the end of code lines on some trimmed code snippets | We now trim overly wide code snippets using `...` before and after as appropriate to signify the cut code. I've observed some cases on spans with labels that the last three characters of the snippet are incorrectly replaced with `...`. | labels: A-diagnostics, T-compiler, C-bug, E-needs-mcve", "label": "question", "label_id": 4} {"id": "rust_65323", "text": "Messed up docs for std::task::Waker | This should be an easy one, but the docs for `std::task::Waker` look like this: \"image\" But it should probably just say `Send` and `Sync` not `trait@Send | labels: E-easy, T-libs-api, A-docs, C-bug", "label": "low", "label_id": 3} {"id": "rust_65325", "text": "reopen https://github.com/rust-lang/rust/issues/52377 for 1.38 rust and it is not appear on 1.37 | i found the https://github.com/rust-lang/rust/issues/52377 bug when used new 1.38.0 rust", "label": "medium", "label_id": 2} {"id": "rust_65326", "text": "Error E0594 is not described in docs | Error E0594 is not described in docs https://doc.rust-lang.org/nightly/error-index.html#E0594 ```rust fn main() { let v = vec![1u16; 10]; let p: &[u16] = &v; p[0] = 3; } ``` ([Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9aefb4be4f107328211", "label": "low", "label_id": 3} {"id": "rust_65329", "text": "Unhelpful error message because of inner line doc | The code ```rust fn main() { let x = 0; let y = x.max(1) //!foo .min(2); } ``` I get this error: ```bash error: expected one of `.`, `;`, `?`, or an operator, found `//!foo` --> src/main.rs:3:22 | 3 | let y = x.max(1) //!foo | ^^^^^^ expected one of `.`, `;`, `?`, or an operator | labels: C-enhancement, A-diagnostics, A-parser, T-compiler", "label": "low", "label_id": 3} {"id": "rust_65330", "text": "rustdoc: Prefixing parent modules to distinguish between items in cases where item names would otherwise be ambiguous | ## Motivation I often run into an issue when reading through rendered documentation where many types exist with the same name and it is unclear which type is being referred to in a function signature or type declaration. Two simple, common examples of this are the `Result` and `E | labels: T-rustdoc, C-feature-request", "label": "low", "label_id": 3} {"id": "rust_65333", "text": "Unnecessary comparison and conditional branch | This is a reopening of #37114 which was fixed in 1.28.0 but seems to have regressed again since 1.30.0. ```rust pub fn foo(v: &mut Vec) { let len = v.len(); assert!(len > 1); v[len - 2] += 1; v.pop(); } ``` The asm for 1.38 is ```asm example::foo: push rax mov rax, qword ptr | labels: A-LLVM, I-slow, T-compiler, C-bug", "label": "medium", "label_id": 2} {"id": "rust_65335", "text": "3rd party objects missing from nightly-2019-10-12 | ``` $ rustup toolchain add nightly-2019-10-11 $ rustup toolchain add nightly-2019-10-12 $ rustup target add --toolchain nightly-2019-10-11 x86_64-fortanix-unknown-sgx $ rustup target add --toolchain nightly-2019-10-12 x86_64-fortanix-unknown-sgx $ ls .rustup/toolchains/nightly-20 | labels: regression-from-stable-to-nightly, P-high, O-windows-gnu, T-bootstrap, O-musl, C-bug", "label": "critical_bug", "label_id": 0} {"id": "rust_65343", "text": "Tracking issue for \"minimize the rust-std component\" | This tracks the issue for doing the stuff mentioned in https://github.com/rust-lang/rust/pull/64823. Also relevant: - https://github.com/rust-lang/rust/issues/61978 - https://github.com/rust-lang/rust/issues/62486 - https://github.com/rust-lang/rust/issues/65335 - https://github. | labels: T-bootstrap, T-infra, C-tracking-issue, T-release", "label": "medium", "label_id": 2} {"id": "rust_65344", "text": "rust-lldb fails to load on LLDB 8.0.0 | When I run `rust-lldb` I get the following error: ``` $ rust-lldb target/debug/myprogram (lldb) command script import \"/Users/zmitchell/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py\" error: module importing failed: loading unimplemented ``` | labels: A-debuginfo, P-medium, T-compiler, T-dev-tools", "label": "medium", "label_id": 2} {"id": "rust_65348", "text": "const fn ICE on nightly | The following ICE's on nightly only: ```Rust struct ArrayType(T); impl ArrayType { const ARRAY: [T; 0] = []; } pub const fn bug() -> &'static T { &ArrayType::::ARRAY[0] } fn main() { bug::(); } ```
Backtrace: ``` [ERROR rustc_mir: | labels: I-ICE, regression-from-stable-to-nightly, T-compiler, C-bug, A-const-eval, glacier", "label": "critical_bug", "label_id": 0} {"id": "rust_65350", "text": "Compiling can take hours. | I've heard that rustc is slow, but I'm actually running into 30 to 120 minute compile times. I only installed rustc yeasterday: rustc 1.38.0 (625451e37 2019-09-23) on Debian Buster. I've tried cloning a couple of game engines from github to compare - Piston, gglz, glium plus a ra", "label": "medium", "label_id": 2} {"id": "rust_65352", "text": "unable to build on windows when \"optimize = false\" | When \"optimize\" in `config.toml` is set to `false`, windows build msvc is unable to build properly. It's due to the limitation of 65535 objects in the linker object. see following error: ``` 316abf8bcc4ba1.rlib\" \"C:\\\\Users\\\\guanq\\\\AppData\\\\Local\\\\Temp\\\\rustcbLuaNn\\\\libsyntax_pos-", "label": "medium", "label_id": 2} {"id": "rust_65354", "text": "Remove disambiguator from intra doc link text | ```rust /// Trait: [`trait@Name`], fn: [`fn@Name`] pub struct S; pub trait Name {} #[allow(non_snake_case)] pub fn Name() {} ``` This is currently rendered as: >