This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(internal_features)] | |
#![feature(duration_millis_float)] | |
#![feature(core_intrinsics)] | |
use std::time::Instant; | |
use std::intrinsics::{select_unpredictable, unlikely}; | |
#[global_allocator] | |
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::Result; | |
use std::mem::{self, MaybeUninit}; | |
// A simple async-ification of sync Read plus downcasting methods. | |
pub trait Read { | |
// async | |
fn read(&mut self, buf: &mut [u8]) -> Result<usize>; | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WARNING: documentation for this crate may be rendered differently using the new Pulldown renderer. | |
See https://github.com/rust-lang/rust/issues/44229 for details. | |
WARNING: rendering difference in `Constructs a `Layout` from a given `size` and `align`,...` | |
--> src/liballoc/allocator.rs:79:4 | |
/html[0]/body[1]/ul[1]/li[1]/p[0] Text differs: | |
expected: `must not exceed 2^31 (i.e.` | |
found: `must not exceed 2` | |
/html[0]/body[1]/ul[1]/li[1]/p[0] Tags differ: expected: `code`, found: `sup` | |
/html[0]/body[1]/ul[1]/li[1]/p[0] Text differs: | |
expected: `),` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Differences spotted in "Utilities for formatting and printing `String`s\n\nThis module contains the runtime support for the [`format!`] syntax extension.\nThis macro is implemented in the compiler to emit calls to this module in\norder to format arguments at runtime into strings.\n\n# Usage\n\nThe [`format!`] macro is intended to be familiar to those coming from C\'s\n`printf`/`fprintf` functions or Python\'s `str.format` function.\n\nSome examples of the [`format!`] extension are:\n\n```\nformat!(\"Hello\"); // => \"Hello\"\nformat!(\"Hello, {}!\", \"world\"); // => \"Hello, world!\"\nformat!(\"The number is {}\", 1); // => \"The number is 1\"\nformat!(\"{:?}\", (3, 4)); // => \"(3, 4)\"\nformat!(\"{value}\", value=4); // => \"4\"\nformat!(\"{} {}\", 1, 2); // => \"1 2\"\nformat!(\"{:04}\", 42); // => \"0042\" with leading zeros\n```\n\nFrom these, you can see that the first argument is a format string. It is\nrequired by the compiler for this to be a s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>>>>>>>>>>>>>>>>>>>>>> | |
Teaching an IDE to understand Rust | |
>>>>>>>>>>>>>>>>>>>>>>> | |
Abstract | |
(A concise, engaging description for the public program. Limited to 600 characters.) | |
IDE support is one of Rust's most requested features. From the 2017 State of Rust Survey: | |
roughly 30% of Rust users are looking forward to IDE support more than any other feature in 2017 and for 22% of | |
non-users, lack of IDE support is their main reason for not using Rust. Thankfully, the Rust Language Server is here now and it gets smarter and | |
more capable every day. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time: 0.013; rss: 62MB parsing | |
time: 0.003; rss: 62MB configuration 1 | |
time: 0.000; rss: 62MB recursion limit | |
time: 0.000; rss: 62MB crate injection | |
time: 0.023; rss: 96MB macro loading | |
time: 0.001; rss: 98MB plugin loading | |
time: 0.000; rss: 98MB plugin registration | |
time: 0.213; rss: 106MB expansion | |
time: 0.021; rss: 106MB configuration 2 | |
time: 0.000; rss: 106MB gated configuration checking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execve("/usr/local/bin/cargo", ["cargo", "rustc", "--", "-Ztime-passes"], [/* 24 vars */]) = 0 | |
brk(0) = 0x7ff9443f7000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff941c74000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/root/rust/x86_64-unknown-linux-gnu/stage2/lib/tls/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/root/rust/x86_64-unknown-linux-gnu/stage2/lib/tls/x86_64", 0x7fffac27ac00) = -1 ENOENT (No such file or directory) | |
open("/root/rust/x86_64-unknown-linux-gnu/stage2/lib/tls/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/root/rust/x86_64-unknown-linux-gnu/stage2/lib/tls", 0x7fffac27ac00) = -1 ENOENT (No such file or directory) | |
open("/root/rust/x86_64-unknown-linux-gnu/stage2/lib/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I think this is every possible way to call a method in Rust. | |
struct Foo; | |
impl Foo { | |
fn m1() { | |
println!("Hello! m1"); | |
} | |
fn m2(&self) { |
NewerOlder