Item | Instantiation count | Estimated Cost Per Instantiation | Total Estimated Cost |
---|---|---|---|
std::thread::LocalKey::::try_with | 3214 | 58 | 186412 |
hashbrown::raw::RawTable::<T, A>::reserve_rehash | 277 | 402 | 111354 |
rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory | 228 | 449 | 102372 |
rustc_query_system::dep_graph::DepGraph::::with_task_impl | 228 | 391 | 89148 |
rustc_query_system::query::plumbing::execute_job | 228 | 376 | 85728 |
rustc_middle::ty::tls::with_context_opt | 1599 | 53 | 84747 |
plumbing::force_from_dep_node | 285 | 296 | 84360 |
std::ptr::const_ptr::::is_aligned_to | 1722 | 46 | 79212 |
PS C:\Users\Joshua Nelson\src\rust2> git worktree add ../rust5 | |
Preparing worktree (new branch 'rust5') | |
Updating files: 100% (38772/38772), done. | |
HEAD is now at e4330295d9b Give a more helpful error for "trimmed_def_paths construted" | |
PS C:\Users\Joshua Nelson\src\rust2> cd ../rust5 | |
PS C:\Users\Joshua Nelson\src\rust5> ./x.ps1 build --dry-run | |
downloading https://static.rust-lang.org/dist/2022-11-01/rust-std-beta-x86_64-pc-windows-msvc.tar.xz | |
#################################################################################################################### 100.0% | |
extracting C:\Users\Joshua Nelson\src\rust5\build\cache\2022-11-01\rust-std-beta-x86_64-pc-windows-msvc.tar.xz | |
downloading https://static.rust-lang.org/dist/2022-11-01/rustc-beta-x86_64-pc-windows-msvc.tar.xz |
Building rustbuild | |
Finished dev [unoptimized] target(s) in 0.04s | |
Building stage0 library artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) | |
Finished release [optimized] target(s) in 38.39s | |
Copying stage0 library from stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu / aarch64-unknown-linux-gnu) | |
Building stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) | |
Finished release [optimized] target(s) in 2m 46s | |
Copying stage0 rustc from stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu / aarch64-unknown-linux-gnu) | |
Assembling stage1 compiler (aarch64-unknown-linux-gnu) | |
Building stage0 tool clippy-driver (aarch64-unknown-linux-gnu) |
[ | |
{"name":"std::thread::LocalKey::<T>::try_with","instantiation_count":3214,"size_estimate":58,"total_estimate":186412}, | |
{"name":"hashbrown::raw::RawTable::<T, A>::reserve_rehash","instantiation_count":277,"size_estimate":402,"total_estimate":111354}, | |
{"name":"rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory","instantiation_count":228,"size_estimate":449,"total_estimate":102372}, | |
{"name":"rustc_query_system::dep_graph::DepGraph::<K>::with_task_impl","instantiation_count":228,"size_estimate":391,"total_estimate":89148}, | |
{"name":"rustc_query_system::query::plumbing::execute_job","instantiation_count":228,"size_estimate":376,"total_estimate":85728}, | |
{"name":"rustc_middle::ty::tls::with_context_opt","instantiation_count":1599,"size_estimate":53,"total_estimate":84747}, | |
{"name":"plumbing::force_from_dep_node","instantiation_count":285,"size_estimate":296,"total_estimate":84360}, | |
{"name":"std::ptr::const_ptr::<impl *const T>::is_aligned_to","instantiation_count":1722,"size_estimate":46,"t |
(I plan to publish this as a blog post once a few people have looked at it and caught the obvious typos.)
I got lots of positive feedback about the FAQ section in my Rust 2020 blog post, so I'm trying that format again for another topic that's been requested a lot: How to fix common borrow-checker issues. This isn't meant to explain how or why the borrow checker works the way it does (see The Nomicon or Two Beautiful Rust Programs for that), just how to work around some of its current limitations.
The main projects I work on are docs.rs, saltwater cc, and the rust compiler itself.
Normally I compile on my laptop, which is a 4 core 7th gen i5 with 8 GB memory.
When I started working on rustc
itself, that was unbearably slow (over 45 minutes for a stage 1 build),
A builtin-macro was attempted to be registered twice.
Erroneous code example:
#![feature(decl_macro)]
#![feature(rustc_attrs)]
#[rustc_builtin_macro]
pub macro test($item:item) {
import sys | |
from collections import defaultdict, Counter | |
def lexer(): | |
for line in sys.stdin: | |
for token in line.split(): | |
yield token | |
def lookup(var, scope): | |
while scope.get(var): |
layout | title | date | audience | excerpt |
---|---|---|---|---|
post |
the-intra-doc-links-saga |
2020-08-08 00:01:14 -0400 |
developers |
N.B. This post assumes some familiarity with [the Rust programming language][rust].
error[E0433]: failed to resolve: could not find `handle` in `sys` | |
--> library/std/src/sys/windows/ext/process.rs:13:27 | |
| | |
13 | let handle = sys::handle::Handle::new(handle as *mut _); | |
| ^^^^^^ could not find `handle` in `sys` | |
error[E0425]: cannot find function `symlink_inner` in module `sys::fs` | |
--> library/std/src/sys/windows/ext/fs.rs:544:14 | |
| | |
544 | sys::fs::symlink_inner(src.as_ref(), dst.as_ref(), false) |