profile
viewpoint

AveryOS/avery 29

x86-64 kernel in Rust

Zoxc/AntiSpam 3

A RedVex anti-spam plugin.

Zoxc/Avery 3

something resembling an microkernel

Zoxc/JassCraft 3

A JASS2 editor

Zoxc/JassParser 3

A parser and typechecker for the JASS2 scripting language.

Zoxc/legion 3

A Galaxy targeting compiler

Zoxc/game 2

Some game.

AveryOS/rust-elfloader 1

Library to load and relocate ELF files.

create barnchZoxc/rust

branch : inlines-query-system

created branch time in 3 days

pull request commentrust-lang/rust

[WIP] Test compiling the compiler with -Z share-generics

@bors try @rust-timer queue

Zoxc

comment created time in 3 days

PR opened rust-lang/rust

[WIP] Test compiling the compiler with -Z share-generics

r? @ghost

+1 -0

0 comment

1 changed file

pr created time in 3 days

create barnchZoxc/rust

branch : test-share-generics

created branch time in 3 days

pull request commentrust-lang/rust

save/restore `pessimistic_yield` when entering bodies

I don't really follow the logic here to well, but won't we also need to save/restore fixup_scopes?

nikomatsakis

comment created time in 3 days

pull request commentrust-lang/rust

[WIP] Allow functions to be inlined across crates without an inline attribute

@bors try @rust-timer queue

Zoxc

comment created time in 3 days

push eventZoxc/rust

Joshua Nelson

commit sha 62722735fb62c2f93656a012c29310155de35467

impl From<[T; N]> for Vec<T>

view details

Joshua Nelson

commit sha daeb8ece8c930174baa874aa3f2f278fbec9637d

fix error compiling stage2 Co-Authored-By: lzutao <taolzu@gmail.com>

view details

Joshua Nelson

commit sha f267d9dc191debfef74cc211dbca3d286b51f761

limit From impl to LengthAtMost32 Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>

view details

Joshua Nelson

commit sha e3d5eaf2bba89db8359393ac7656db19cb421fb5

add ui-tests

view details

Joshua Nelson

commit sha ba46b61bbcd0d2860105c429cf73254c388e9118

bless UI tests

view details

Joshua Nelson

commit sha 96794d86f127dd409760765a64a36c07d9ed585f

fix test failure

view details

Joshua Nelson

commit sha 1ac4a461425b7a2e29aeb3c2b2cae944f8cbcc77

make the impl a little prettier

view details

Joshua Nelson

commit sha 8212584c9ecdbd91736fc7a480fe3b7409b73477

Bump release cutoff

view details

Joshua Nelson

commit sha 3477e67a92878adae48b975915cb7a5c21026cd4

Allow vec.rs to be over 3000 lines :(

view details

Tomasz Miąsko

commit sha 7fdc3efb7ad6e9f73110f8e2e01120cd022b5fc9

Add copy bound to atomic intrinsics

view details

Tomasz Miąsko

commit sha ec853b6b60e9cbe7b07458f9c33f0bb3f52e0776

Add copy bound to numeric intrinsics

view details

Wim Looman

commit sha 6fe7867ea6f5f912346d75459499fca88f6ae563

Add Result<Result<T, E>, E>::flatten -> Result<T, E>

view details

Dillon Amburgey

commit sha 37c63edfc4462381ee0669b17d593a307a985c52

Validate git setup before accessing functionality

view details

Vadim Petrochenkov

commit sha 733230530522d9f535b95d5bc304b11a94e2239c

Remove attribute `#[structural_match]` and any references to it

view details

Ana-Maria Mihalache

commit sha 50d2c3abd59af8cbed7e001b5b4e2f6a9a011112

Rename TyLayout to TyAndLayout.

view details

Ralf Jung

commit sha 8bad4844b2034ff347479cc27275dc9ea8899f15

rename Scalar::{ptr_null -> null_ptr}

view details

Ralf Jung

commit sha 01dbaeda3242d48bb7b432f5fa2c0506e326551c

use machine_ prefix for target usize/isize

view details

Ralf Jung

commit sha 1a0e69d34f8fde29224875525e66dffb863cbaba

use more specialized Scalar::from_ constructors where appropriate

view details

Ralf Jung

commit sha 1f53fdc82c27c4b8bf933c72378412d830db8d01

get rid of useless back-and-forth cast

view details

Ralf Jung

commit sha bd9e04649669cf9d2736fc531727bfe733953cea

refmt

view details

push time in 3 days

PR opened rust-lang/rust

[WIP] Allow functions to be inline across crates without an inline attribute

r? @ghost

+242 -32

0 comment

16 changed files

pr created time in 3 days

create barnchZoxc/rust

branch : infer-inline

created branch time in 3 days

pull request commentrust-lang/rust

Move the query system to a dedicated crate

Looks like this regressed incremental benchmarks. There's probably some things that could use #[inline] attributes here.

cjgillot

comment created time in 4 days

push eventZoxc/rust

Aaron Hill

commit sha ff65bffe2b143528ff90d5226b18ceca750d7c02

Fix cycle error when emitting suggestion for mismatched `fn` type Fixes #66667 Previously, we called `tcx.typeck_tables_of` when determining whether or not to emit a suggestion for a type error. However, we might already be type-checking the `DefId` we pass to `typeck_tables_of` (it could be anywhere in the query stack). Fortunately, we only need the function signature, not the entire `TypeckTables`. By using `tcx.fn_sig`, we avoid the possibility of cycle errors while retaining the ability to emit a suggestion.

view details

TyPR124

commit sha ef2957de137fb8d6959310e5d8f2fa1d600d7d36

allowing getting &mut OsStr from OsString

view details

TyPR124

commit sha 21975a1aaa682a88266970459f6f67829774d6c4

add comments about safety

view details

TyPR124

commit sha cce8ee8bf7dbf461872d72c8b29302242bb11701

remove #[inline] for consistency in windows/os_str

view details

TyPR124

commit sha 16712ede6202067d0c1b2e23ad95b87e0afd7191

corrections on safety comments

view details

TyPR124

commit sha e4a65e83e7ce89ce7a015753a4b8d989416ae2a8

make safety comments more explicit

view details

Joshua M. Clulow

commit sha a83e6c7328f3fe8c78445fdb8088d7a7fa6f8897

use "gcc" instead of "cc" on *-sun-solaris systems when linking On illumos and Solaris systems, Rust will use GCC as the link editor. Rust does this by invoking "cc", which on many (Linux and perhaps BSD) systems is generally either GCC or a GCC-compatible front-end. On historical Solaris systems, "cc" was often the Sun Studio compiler. This history casts a long shadow, and as such, even most modern illumos-based operating systems tend to install GCC as "gcc", without also making it available as "cc". We should invoke GCC as "gcc" on such systems to ensure we get the right compiler driver.

view details

Joshua M. Clulow

commit sha 1c191c304aa5629e31c93bec395fe4255ecca9ce

review feedback: add a comment describing the situation

view details

TyPR124

commit sha 45416cd91a6bdc493ea62fb3f412713a0fd8e52e

add comment about maintaining OsStr encoding

view details

Mark Rousskov

commit sha 903f67d599cf12d2d202d5177bb3edecb6cdab00

Avoid re-fetching Unicode data If the unicode-downloads folder already exists, we likely just fetched the data, so don't make any further network requests. Unicode versions are released rarely enough that this doesn't matter much in practice.

view details

Mark Rousskov

commit sha 7c4baedb3a090f2dc9e653bd7c03165be84acad3

Dynamically choose best chunk size Try chunk sizes between 1 and 64, selecting the one which minimizes the number of bytes used. 16, the previous constant, turned out to be a rather good choice, with 5/9 of the datasets still using it. Alphabetic : 3036 bytes (- 19 bytes) Case_Ignorable : 2136 bytes Cased : 934 bytes Cc : 32 bytes (- 11 bytes) Grapheme_Extend: 1774 bytes Lowercase : 985 bytes N : 1225 bytes (- 41 bytes) Uppercase : 934 bytes White_Space : 97 bytes (- 43 bytes) Total table sizes: 11153 bytes (-114 bytes)

view details

Mark Rousskov

commit sha 580a6342ef9d435d241b74e86b99dc1131a526f8

Generate tests for Unicode property data Currently the test file takes a while to compile -- 30 seconds or so -- but since it's not going to be committed, and is just for local testing, that seems fine.

view details

Mark Rousskov

commit sha 6c7691a37bf485b28fecb6856e6ede8fa952f99e

Pre-pop zero chunks before mapping LAST_CHUNK_MAP This avoids wasting a small amount of space for some of the data sets. The chunk resizing is caused by but not directly related to changes in this commit. Alphabetic : 3036 bytes Case_Ignorable : 2133 bytes (- 3 bytes) Cased : 934 bytes Cc : 32 bytes Grapheme_Extend: 1760 bytes (-14 bytes) Lowercase : 985 bytes N : 1220 bytes (- 5 bytes) Uppercase : 934 bytes White_Space : 97 bytes Total table sizes: 11131 bytes (-22 bytes)

view details

Mark Rousskov

commit sha b0e121d9d588b334eaa1b68a127f5ee0fcda4296

Shrink bitset words through functional mapping Previously, all words in the (deduplicated) bitset would be stored raw -- a full 64 bits (8 bytes). Now, those words that are equivalent to others through a specific mapping are stored separately and "mapped" to the original when loading; this shrinks the table sizes significantly, as each mapped word is stored in 2 bytes (a 4x decrease from the previous). The new encoding is also potentially non-optimal: the "mapped" byte is frequently repeated, as in practice many mapped words use the same base word. Currently we only support two forms of mapping: rotation and inversion. Note that these are both guaranteed to map transitively if at all, and supporting mappings for which this is not true may require a more interesting algorithm for choosing the optimal pairing. Updated sizes: Alphabetic : 2622 bytes (- 414 bytes) Case_Ignorable : 1803 bytes (- 330 bytes) Cased : 808 bytes (- 126 bytes) Cc : 32 bytes Grapheme_Extend: 1508 bytes (- 252 bytes) Lowercase : 901 bytes (- 84 bytes) N : 1064 bytes (- 156 bytes) Uppercase : 838 bytes (- 96 bytes) White_Space : 91 bytes (- 6 bytes) Total table sizes: 9667 bytes (-1,464 bytes)

view details

Mark Rousskov

commit sha 7b29b70d6ea52e9324f9328bed9beb6cf516c1ce

Add a right shift mapping This saves less bytes - by far - and is likely not the best operator to choose. But for now, it works -- a better choice may arise later. Alphabetic : 2538 bytes (- 84 bytes) Case_Ignorable : 1773 bytes (- 30 bytes) Cased : 790 bytes (- 18 bytes) Cc : 26 bytes (- 6 bytes) Grapheme_Extend: 1490 bytes (- 18 bytes) Lowercase : 865 bytes (- 36 bytes) N : 1040 bytes (- 24 bytes) Uppercase : 778 bytes (- 60 bytes) White_Space : 85 bytes (- 6 bytes) Total table sizes: 9385 bytes (-282 bytes)

view details

Mark Rousskov

commit sha 5f71d98f90354f9ee67c2b77c8607fbc9169d63e

Deduplicate test and primary range_search definitions This ensures that what we test is what we get for final results as well.

view details

Mark Rousskov

commit sha 233ab2f168d29d5e77abc1bc6c3923edf3575e08

Push the byte of LAST_CHUNK_MAP into the array This optimizes slightly better. Alphabetic : 2536 bytes Case_Ignorable : 1771 bytes Cased : 788 bytes Cc : 24 bytes Grapheme_Extend: 1488 bytes Lowercase : 863 bytes N : 1038 bytes Uppercase : 776 bytes White_Space : 83 bytes Total table sizes: 9367 bytes (-18 bytes; 2 bytes per set)

view details

Mark Rousskov

commit sha a7ec6f8fe0fb10fa91ac40f68beccd2675cba50c

Arrange for zero to be canonical We find that it is common for large ranges of chars to be false -- and that means that it is plausibly common for us to ask about a word that is entirely empty. Therefore, we should make sure that we do not need to rotate bits or otherwise perform some operation to map to the zero word; canonicalize it first if possible.

view details

Mark Rousskov

commit sha af243d4d91400e071a5b8fe5041f55f07fd8a928

Avoid relying on const parameters to function LLVM seems to at least sometimes optimize better when the length comes directly from the `len()` of the array vs. an equivalent integer. Also, this allows easier copy/pasting of the function into compiler explorer for experimentation.

view details

Bastian Kauschke

commit sha 513ea6405b121e589dafad738b600cab5baa2ab6

add missing visit_consts

view details

push time in 4 days

pull request commentrust-lang/rust

Polymorphization

@davidtwco We don't run tests for the parallel compiler so it's expected that not all tests pass there.

davidtwco

comment created time in 4 days

push eventZoxc/rust

Lukas Lueg

commit sha becebf3106407b892f25807473e23d6e8f116a1e

Ammend Rc/Arc::from_raw() docs regarding unsafety Constructing an Rc/Arc is unsafe even if the wrapped `T` is never dereferenced.

view details

Lukas Lueg

commit sha b4c96a9199f13c5c1c2afa6258d2b9206c151d9f

Refine [Arc/Rc]::from_raw() docs

view details

Lukas Lueg

commit sha 586c7e3907738938db7a6730fd70d7125f5925fa

Make rc::RcBox and sync::ArcInner repr(C) Future-proof these types in case rustc reorders the inner fields. As per discussion in PR #68099.

view details

Guillaume Gomez

commit sha c57de34e8feca218c0c696b621de87c078a2a0e0

Stabilize --crate-version option in rustdoc

view details

Markus Westerlind

commit sha c6f1215d925561021eec296d9e88aa0305d0a18d

perf(dep_graph): Avoid allocating a set on when the number reads are small `reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd` benchmark which I believe is due to the number of reads are very low in many cases (see https://github.com/rust-lang/rust/pull/50565 for instance). This avoids allocating the set until we start allocating the `reads` `SmallVec` but it is possible that a lower limit might be better (not tested since the improvement will be hard to spot either way).

view details

Arkadiusz Piekarz

commit sha b90edfcc9e1c4ff547b012c41ba2d55974794a7e

Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book

view details

Markus Westerlind

commit sha 4168c25b0f8aadcfe38c8bdae7cc51c22c2f45d1

refactor: Add an alias for the SmallVec in dep_graph

view details

Matt Cooper

commit sha ec7010a1a8ae59a7538e649218665497306eb8b1

establish immutable source for RUST_CONFIGURE_ARGS

view details

Matt Cooper

commit sha a942b3946521db46ba653693f5d6e477e39bbb3b

fix how we detect an unset variable

view details

Aaron Hill

commit sha ff65bffe2b143528ff90d5226b18ceca750d7c02

Fix cycle error when emitting suggestion for mismatched `fn` type Fixes #66667 Previously, we called `tcx.typeck_tables_of` when determining whether or not to emit a suggestion for a type error. However, we might already be type-checking the `DefId` we pass to `typeck_tables_of` (it could be anywhere in the query stack). Fortunately, we only need the function signature, not the entire `TypeckTables`. By using `tcx.fn_sig`, we avoid the possibility of cycle errors while retaining the ability to emit a suggestion.

view details

Tomasz Miąsko

commit sha 24dc2cb133d5b1cdd0680b91e4295039d704a610

librustc_codegen_llvm: Replace deprecated API usage

view details

Matt Cooper

commit sha 330233470e74f76731cc6f702302e9978d363285

fix a glaring typo

view details

TyPR124

commit sha ef2957de137fb8d6959310e5d8f2fa1d600d7d36

allowing getting &mut OsStr from OsString

view details

TyPR124

commit sha 21975a1aaa682a88266970459f6f67829774d6c4

add comments about safety

view details

TyPR124

commit sha cce8ee8bf7dbf461872d72c8b29302242bb11701

remove #[inline] for consistency in windows/os_str

view details

TyPR124

commit sha 16712ede6202067d0c1b2e23ad95b87e0afd7191

corrections on safety comments

view details

TyPR124

commit sha e4a65e83e7ce89ce7a015753a4b8d989416ae2a8

make safety comments more explicit

view details

Joshua M. Clulow

commit sha a83e6c7328f3fe8c78445fdb8088d7a7fa6f8897

use "gcc" instead of "cc" on *-sun-solaris systems when linking On illumos and Solaris systems, Rust will use GCC as the link editor. Rust does this by invoking "cc", which on many (Linux and perhaps BSD) systems is generally either GCC or a GCC-compatible front-end. On historical Solaris systems, "cc" was often the Sun Studio compiler. This history casts a long shadow, and as such, even most modern illumos-based operating systems tend to install GCC as "gcc", without also making it available as "cc". We should invoke GCC as "gcc" on such systems to ensure we get the right compiler driver.

view details

Ana-Maria Mihalache

commit sha 7d400199c2b1778ba7fd4748a5cb16d926a85d67

rustc_mir: remove extra space when pretty-printing MIR.

view details

Joshua M. Clulow

commit sha 1c191c304aa5629e31c93bec395fe4255ecca9ce

review feedback: add a comment describing the situation

view details

push time in 4 days

pull request commentrust-lang/rust

Move the query system to a dedicated crate

@bors r+

cjgillot

comment created time in 6 days

pull request commentrust-lang/rust

Move LLVM bitcode destination

What's the motivation behind this? Wouldn't this cause more work for linkers?

nnethercote

comment created time in 6 days

pull request commentrust-lang/rust

Move the query system to a dedicated crate

@bors p=1 r+

cjgillot

comment created time in 6 days

pull request commentrust-lang/rust

[WIP] Only put inline functions in one CGU

@bors try @rust-timer queue

Zoxc

comment created time in 6 days

PR opened rust-lang/rust

[WIP] Only put inline functions in one CGU

r? @ghost

+4 -18

0 comment

1 changed file

pr created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha d490d39b761016c06b8bb9140b7edf26108110be

Only put inline functions in one CGU

view details

push time in 6 days

create barnchZoxc/rust

branch : inline-in-one-cgu

created branch time in 6 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 extern crate rustc_data_structures; pub mod dep_graph; pub mod query; -pub trait HashStableContext {-    fn debug_dep_tasks(&self) -> bool;-}+pub trait HashStableContext {}

This trait seems useless now =P

cjgillot

comment created time in 6 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

+//! The implementation of the query system itself. This defines the macros that+//! generate the actual methods on tcx which find and execute the provider,+//! manage the caches, and so forth.++use crate::dep_graph::{DepKind, DepNode};+use crate::dep_graph::{DepNodeIndex, SerializedDepNodeIndex};+use crate::query::caches::QueryCache;+use crate::query::config::{QueryContext, QueryDescription};+use crate::query::job::{QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryShardJobId};++#[cfg(not(parallel_compiler))]+use rustc_data_structures::cold_path;+use rustc_data_structures::fingerprint::Fingerprint;+use rustc_data_structures::fx::{FxHashMap, FxHasher};+use rustc_data_structures::sharded::Sharded;+use rustc_data_structures::sync::{Lock, LockGuard};+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::{Diagnostic, FatalError};+use rustc_span::source_map::DUMMY_SP;+use rustc_span::Span;+use std::collections::hash_map::Entry;+use std::convert::TryFrom;+use std::fmt::Debug;+use std::hash::{Hash, Hasher};+use std::mem;+use std::num::NonZeroU32;+use std::ptr;+#[cfg(debug_assertions)]+use std::sync::atomic::{AtomicUsize, Ordering};++pub struct QueryStateShard<CTX: QueryContext, K, C> {+    pub(super) cache: C,+    active: FxHashMap<K, QueryResult<CTX>>,++    /// Used to generate unique ids for active jobs.+    jobs: u32,+}++impl<CTX: QueryContext, K, C: Default> Default for QueryStateShard<CTX, K, C> {+    fn default() -> QueryStateShard<CTX, K, C> {+        QueryStateShard { cache: Default::default(), active: Default::default(), jobs: 0 }+    }+}++pub struct QueryState<CTX: QueryContext, C: QueryCache> {+    cache: C,+    shards: Sharded<QueryStateShard<CTX, C::Key, C::Sharded>>,+    #[cfg(debug_assertions)]+    pub cache_hits: AtomicUsize,+}++impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {+    pub(super) fn get_lookup<'tcx>(+        &'tcx self,+        key: &C::Key,+    ) -> QueryLookup<'tcx, CTX, C::Key, C::Sharded> {+        // We compute the key's hash once and then use it for both the+        // shard lookup and the hashmap lookup. This relies on the fact+        // that both of them use `FxHasher`.+        let mut hasher = FxHasher::default();+        key.hash(&mut hasher);+        let key_hash = hasher.finish();++        let shard = self.shards.get_shard_index_by_hash(key_hash);+        let lock = self.shards.get_shard_by_index(shard).lock();+        QueryLookup { key_hash, shard, lock }+    }+}++/// Indicates the state of a query for a given key in a query map.+enum QueryResult<CTX: QueryContext> {+    /// An already executing query. The query job can be used to await for its completion.+    Started(QueryJob<CTX>),++    /// The query panicked. Queries trying to wait on this will raise a fatal error which will+    /// silently panic.+    Poisoned,+}++impl<CTX: QueryContext, C: QueryCache> QueryState<CTX, C> {+    pub fn iter_results<R>(+        &self,+        f: impl for<'a> FnOnce(+            Box<dyn Iterator<Item = (&'a C::Key, &'a C::Value, DepNodeIndex)> + 'a>,+        ) -> R,+    ) -> R {+        self.cache.iter(&self.shards, |shard| &mut shard.cache, f)+    }++    pub fn all_inactive(&self) -> bool {+        let shards = self.shards.lock_shards();+        shards.iter().all(|shard| shard.active.is_empty())+    }++    pub fn try_collect_active_jobs(+        &self,+        kind: CTX::DepKind,+        make_query: fn(C::Key) -> CTX::Query,+        jobs: &mut FxHashMap<QueryJobId<CTX::DepKind>, QueryJobInfo<CTX>>,+    ) -> Option<()>+    where+        C::Key: Clone,+    {+        // We use try_lock_shards here since we are called from the+        // deadlock handler, and this shouldn't be locked.+        let shards = self.shards.try_lock_shards()?;+        let shards = shards.iter().enumerate();+        jobs.extend(shards.flat_map(|(shard_id, shard)| {+            shard.active.iter().filter_map(move |(k, v)| {+                if let QueryResult::Started(ref job) = *v {+                    let id =+                        QueryJobId { job: job.id, shard: u16::try_from(shard_id).unwrap(), kind };+                    let info = QueryInfo { span: job.span, query: make_query(k.clone()) };+                    Some((id, QueryJobInfo { info, job: job.clone() }))+                } else {+                    None+                }+            })+        }));++        Some(())+    }+}++impl<CTX: QueryContext, C: QueryCache> Default for QueryState<CTX, C> {+    fn default() -> QueryState<CTX, C> {+        QueryState {+            cache: C::default(),+            shards: Default::default(),+            #[cfg(debug_assertions)]+            cache_hits: AtomicUsize::new(0),+        }+    }+}++/// Values used when checking a query cache which can be reused on a cache-miss to execute the query.+pub struct QueryLookup<'tcx, CTX: QueryContext, K, C> {+    pub(super) key_hash: u64,+    shard: usize,+    pub(super) lock: LockGuard<'tcx, QueryStateShard<CTX, K, C>>,+}++/// A type representing the responsibility to execute the job in the `job` field.+/// This will poison the relevant query if dropped.+struct JobOwner<'tcx, CTX: QueryContext, C>+where+    C: QueryCache,+    C::Key: Eq + Hash + Clone + Debug,+    C::Value: Clone,+{+    state: &'tcx QueryState<CTX, C>,+    key: C::Key,+    id: QueryJobId<CTX::DepKind>,+}++impl<'tcx, CTX: QueryContext, C> JobOwner<'tcx, CTX, C>+where+    C: QueryCache,+    C::Key: Eq + Hash + Clone + Debug,+    C::Value: Clone,+{+    /// Either gets a `JobOwner` corresponding the query, allowing us to+    /// start executing the query, or returns with the result of the query.+    /// This function assumes that `try_get_cached` is already called and returned `lookup`.+    /// If the query is executing elsewhere, this will wait for it and return the result.+    /// If the query panicked, this will silently panic.+    ///+    /// This function is inlined because that results in a noticeable speed-up+    /// for some compile-time benchmarks.+    #[inline(always)]+    fn try_start<'a, 'b, Q>(+        tcx: CTX,+        span: Span,+        key: &C::Key,+        mut lookup: QueryLookup<'a, CTX, C::Key, C::Sharded>,+    ) -> TryGetJob<'b, CTX, C>+    where+        Q: QueryDescription<CTX, Key = C::Key, Value = C::Value, Cache = C>,+        CTX: QueryContext,+    {+        let lock = &mut *lookup.lock;++        let (latch, mut _query_blocked_prof_timer) = match lock.active.entry((*key).clone()) {+            Entry::Occupied(mut entry) => {+                match entry.get_mut() {+                    QueryResult::Started(job) => {+                        // For parallel queries, we'll block and wait until the query running+                        // in another thread has completed. Record how long we wait in the+                        // self-profiler.+                        let _query_blocked_prof_timer = if cfg!(parallel_compiler) {+                            Some(tcx.profiler().query_blocked())+                        } else {+                            None+                        };++                        // Create the id of the job we're waiting for+                        let id = QueryJobId::new(job.id, lookup.shard, Q::DEP_KIND);++                        (job.latch(id), _query_blocked_prof_timer)+                    }+                    QueryResult::Poisoned => FatalError.raise(),+                }+            }+            Entry::Vacant(entry) => {+                // No job entry for this query. Return a new one to be started later.++                // Generate an id unique within this shard.+                let id = lock.jobs.checked_add(1).unwrap();+                lock.jobs = id;+                let id = QueryShardJobId(NonZeroU32::new(id).unwrap());++                let global_id = QueryJobId::new(id, lookup.shard, Q::DEP_KIND);++                let job = tcx.current_query_job();+                let job = QueryJob::new(id, span, job);++                entry.insert(QueryResult::Started(job));++                let owner =+                    JobOwner { state: Q::query_state(tcx), id: global_id, key: (*key).clone() };+                return TryGetJob::NotYetStarted(owner);+            }+        };+        mem::drop(lookup.lock);++        // If we are single-threaded we know that we have cycle error,+        // so we just return the error.+        #[cfg(not(parallel_compiler))]+        return TryGetJob::Cycle(cold_path(|| {+            Q::handle_cycle_error(tcx, latch.find_cycle_in_stack(tcx, span))+        }));++        // With parallel queries we might just have to wait on some other+        // thread.+        #[cfg(parallel_compiler)]+        {+            let result = latch.wait_on(tcx, span);++            if let Err(cycle) = result {+                return TryGetJob::Cycle(Q::handle_cycle_error(tcx, cycle));+            }++            let cached = try_get_cached(+                tcx,+                Q::query_state(tcx),+                (*key).clone(),+                |value, index| (value.clone(), index),+                |_, _| panic!("value must be in cache after waiting"),+            );++            if let Some(prof_timer) = _query_blocked_prof_timer.take() {+                prof_timer.finish_with_query_invocation_id(cached.1.into());+            }++            return TryGetJob::JobCompleted(cached);+        }+    }++    /// Completes the query by updating the query cache with the `result`,+    /// signals the waiter and forgets the JobOwner, so it won't poison the query+    #[inline(always)]+    fn complete(self, tcx: CTX, result: &C::Value, dep_node_index: DepNodeIndex) {+        // We can move out of `self` here because we `mem::forget` it below+        let key = unsafe { ptr::read(&self.key) };+        let state = self.state;++        // Forget ourself so our destructor won't poison the query+        mem::forget(self);++        let job = {+            let result = result.clone();+            let mut lock = state.shards.get_shard_by_value(&key).lock();+            let job = match lock.active.remove(&key).unwrap() {+                QueryResult::Started(job) => job,+                QueryResult::Poisoned => panic!(),+            };+            state.cache.complete(tcx, &mut lock.cache, key, result, dep_node_index);+            job+        };++        job.signal_complete();+    }+}++#[inline(always)]+fn with_diagnostics<F, R>(f: F) -> (R, ThinVec<Diagnostic>)+where+    F: FnOnce(Option<&Lock<ThinVec<Diagnostic>>>) -> R,+{+    let diagnostics = Lock::new(ThinVec::new());+    let result = f(Some(&diagnostics));+    (result, diagnostics.into_inner())+}++impl<'tcx, CTX: QueryContext, C: QueryCache> Drop for JobOwner<'tcx, CTX, C>+where+    C::Key: Eq + Hash + Clone + Debug,+    C::Value: Clone,+{+    #[inline(never)]+    #[cold]+    fn drop(&mut self) {+        // Poison the query so jobs waiting on it panic.+        let state = self.state;+        let shard = state.shards.get_shard_by_value(&self.key);+        let job = {+            let mut shard = shard.lock();+            let job = match shard.active.remove(&self.key).unwrap() {+                QueryResult::Started(job) => job,+                QueryResult::Poisoned => panic!(),+            };+            shard.active.insert(self.key.clone(), QueryResult::Poisoned);+            job+        };+        // Also signal the completion of the job, so waiters+        // will continue execution.+        job.signal_complete();+    }+}++#[derive(Clone)]+pub struct CycleError<Q> {+    /// The query and related span that uses the cycle.+    pub usage: Option<(Span, Q)>,+    pub cycle: Vec<QueryInfo<Q>>,+}++/// The result of `try_start`.+enum TryGetJob<'tcx, CTX: QueryContext, C: QueryCache>+where+    C::Key: Eq + Hash + Clone + Debug,+    C::Value: Clone,+{+    /// The query is not yet started. Contains a guard to the cache eventually used to start it.+    NotYetStarted(JobOwner<'tcx, CTX, C>),++    /// The query was already completed.+    /// Returns the result of the query and its dep-node index+    /// if it succeeded or a cycle error if it failed.+    #[cfg(parallel_compiler)]+    JobCompleted((C::Value, DepNodeIndex)),++    /// Trying to execute the query resulted in a cycle.+    Cycle(C::Value),+}++/// Checks if the query is already computed and in the cache.+/// It returns the shard index and a lock guard to the shard,+/// which will be used if the query is not in the cache and we need+/// to compute it.+#[inline(always)]+fn try_get_cached<CTX, C, R, OnHit, OnMiss>(+    tcx: CTX,+    state: &QueryState<CTX, C>,+    key: C::Key,+    // `on_hit` can be called while holding a lock to the query cache+    on_hit: OnHit,+    on_miss: OnMiss,+) -> R+where+    C: QueryCache,+    CTX: QueryContext,+    OnHit: FnOnce(&C::Value, DepNodeIndex) -> R,+    OnMiss: FnOnce(C::Key, QueryLookup<'_, CTX, C::Key, C::Sharded>) -> R,+{+    state.cache.lookup(+        state,+        key,+        |value, index| {+            if unlikely!(tcx.profiler().enabled()) {+                tcx.profiler().query_cache_hit(index.into());+            }+            #[cfg(debug_assertions)]+            {+                state.cache_hits.fetch_add(1, Ordering::Relaxed);+            }+            on_hit(value, index)+        },+        on_miss,+    )+}++#[inline(always)]+fn try_execute_query<Q, CTX>(+    tcx: CTX,+    span: Span,+    key: Q::Key,+    lookup: QueryLookup<'_, CTX, Q::Key, <Q::Cache as QueryCache>::Sharded>,+) -> Q::Value+where+    Q: QueryDescription<CTX>,+    CTX: QueryContext,+{+    let job = match JobOwner::try_start::<Q>(tcx, span, &key, lookup) {+        TryGetJob::NotYetStarted(job) => job,+        TryGetJob::Cycle(result) => return result,+        #[cfg(parallel_compiler)]+        TryGetJob::JobCompleted((v, index)) => {+            tcx.dep_graph().read_index(index);+            return v;+        }+    };++    // Fast path for when incr. comp. is off. `to_dep_node` is+    // expensive for some `DepKind`s.+    if !tcx.dep_graph().is_fully_enabled() {+        let null_dep_node = DepNode::new_no_params(DepKind::NULL);+        return force_query_with_job::<Q, _>(tcx, key, job, null_dep_node).0;+    }++    if Q::ANON {+        let prof_timer = tcx.profiler().query_provider();++        let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {+            tcx.start_query(job.id, diagnostics, |tcx| {+                tcx.dep_graph().with_anon_task(Q::DEP_KIND, || Q::compute(tcx, key))+            })+        });++        prof_timer.finish_with_query_invocation_id(dep_node_index.into());++        tcx.dep_graph().read_index(dep_node_index);++        if unlikely!(!diagnostics.is_empty()) {+            tcx.store_diagnostics_for_anon_node(dep_node_index, diagnostics);+        }++        job.complete(tcx, &result, dep_node_index);++        return result;+    }++    let dep_node = Q::to_dep_node(tcx, &key);++    if !Q::EVAL_ALWAYS {+        // The diagnostics for this query will be+        // promoted to the current session during+        // `try_mark_green()`, so we can ignore them here.+        let loaded = tcx.start_query(job.id, None, |tcx| {+            let marked = tcx.dep_graph().try_mark_green_and_read(tcx, &dep_node);+            marked.map(|(prev_dep_node_index, dep_node_index)| {+                (+                    load_from_disk_and_cache_in_memory::<Q, _>(+                        tcx,+                        key.clone(),+                        prev_dep_node_index,+                        dep_node_index,+                        &dep_node,+                    ),+                    dep_node_index,+                )+            })+        });+        if let Some((result, dep_node_index)) = loaded {+            job.complete(tcx, &result, dep_node_index);+            return result;+        }+    }++    let (result, dep_node_index) = force_query_with_job::<Q, _>(tcx, key, job, dep_node);+    tcx.dep_graph().read_index(dep_node_index);+    result+}++fn load_from_disk_and_cache_in_memory<Q, CTX>(+    tcx: CTX,+    key: Q::Key,+    prev_dep_node_index: SerializedDepNodeIndex,+    dep_node_index: DepNodeIndex,+    dep_node: &DepNode<CTX::DepKind>,+) -> Q::Value+where+    CTX: QueryContext,+    Q: QueryDescription<CTX>,+{+    // Note this function can be called concurrently from the same query+    // We must ensure that this is handled correctly.++    debug_assert!(tcx.dep_graph().is_green(dep_node));++    // First we try to load the result from the on-disk cache.+    let result = if Q::cache_on_disk(tcx, key.clone(), None) {+        let prof_timer = tcx.profiler().incr_cache_loading();+        let result = Q::try_load_from_disk(tcx, prev_dep_node_index);+        prof_timer.finish_with_query_invocation_id(dep_node_index.into());++        // We always expect to find a cached result for things that+        // can be forced from `DepNode`.+        debug_assert!(+            !dep_node.kind.can_reconstruct_query_key() || result.is_some(),+            "missing on-disk cache entry for {:?}",+            dep_node+        );+        result+    } else {+        // Some things are never cached on disk.+        None+    };++    let result = if let Some(result) = result {+        result+    } else {+        // We could not load a result from the on-disk cache, so+        // recompute.+        let prof_timer = tcx.profiler().query_provider();++        // The dep-graph for this computation is already in-place.+        let result = tcx.dep_graph().with_ignore(|| Q::compute(tcx, key));++        prof_timer.finish_with_query_invocation_id(dep_node_index.into());++        result+    };++    // If `-Zincremental-verify-ich` is specified, re-hash results from+    // the cache and make sure that they have the expected fingerprint.+    if unlikely!(tcx.incremental_verify_ich()) {+        incremental_verify_ich::<Q, _>(tcx, &result, dep_node, dep_node_index);+    }++    result+}++#[inline(never)]+#[cold]+fn incremental_verify_ich<Q, CTX>(+    tcx: CTX,+    result: &Q::Value,+    dep_node: &DepNode<CTX::DepKind>,+    dep_node_index: DepNodeIndex,+) where+    CTX: QueryContext,+    Q: QueryDescription<CTX>,+{+    assert!(+        Some(tcx.dep_graph().fingerprint_of(dep_node_index))+            == tcx.dep_graph().prev_fingerprint_of(dep_node),+        "fingerprint for green query instance not loaded from cache: {:?}",+        dep_node,+    );++    debug!("BEGIN verify_ich({:?})", dep_node);+    let mut hcx = tcx.create_stable_hashing_context();++    let new_hash = Q::hash_result(&mut hcx, result).unwrap_or(Fingerprint::ZERO);+    debug!("END verify_ich({:?})", dep_node);++    let old_hash = tcx.dep_graph().fingerprint_of(dep_node_index);++    assert!(new_hash == old_hash, "found unstable fingerprints for {:?}", dep_node,);+}++#[inline(always)]+fn force_query_with_job<Q, CTX>(+    tcx: CTX,+    key: Q::Key,+    job: JobOwner<'_, CTX, Q::Cache>,+    dep_node: DepNode<CTX::DepKind>,+) -> (Q::Value, DepNodeIndex)+where+    Q: QueryDescription<CTX>,+    CTX: QueryContext,+{+    // If the following assertion triggers, it can have two reasons:+    // 1. Something is wrong with DepNode creation, either here or+    //    in `DepGraph::try_mark_green()`.+    // 2. Two distinct query keys get mapped to the same `DepNode`+    //    (see for example #48923).+    assert!(+        !tcx.dep_graph().dep_node_exists(&dep_node),+        "forcing query with already existing `DepNode`\n\+                 - query-key: {:?}\n\+                 - dep-node: {:?}",+        key,+        dep_node+    );++    let prof_timer = tcx.profiler().query_provider();++    let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {+        tcx.start_query(job.id, diagnostics, |tcx| {+            if Q::EVAL_ALWAYS {+                tcx.dep_graph().with_eval_always_task(+                    dep_node,+                    tcx,+                    key,+                    Q::compute,+                    Q::hash_result,+                )+            } else {+                tcx.dep_graph().with_task(dep_node, tcx, key, Q::compute, Q::hash_result)+            }+        })+    });++    prof_timer.finish_with_query_invocation_id(dep_node_index.into());++    if unlikely!(!diagnostics.is_empty()) {+        if dep_node.kind != DepKind::NULL {+            tcx.store_diagnostics(dep_node_index, diagnostics);+        }+    }++    job.complete(tcx, &result, dep_node_index);++    (result, dep_node_index)+}++pub trait QueryGetter: QueryContext {

The methods in this trait should be freestanding. Any particular reason why a trait was used here?

cjgillot

comment created time in 6 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

+//! Query configuration and description traits.++use crate::dep_graph::SerializedDepNodeIndex;+use crate::dep_graph::{DepContext, DepGraph, DepNode};+use crate::query::caches::QueryCache;+use crate::query::job::{QueryJobId, QueryJobInfo};+use crate::query::plumbing::CycleError;+use crate::query::QueryState;+use rustc_data_structures::profiling::ProfileCategory;+use rustc_span::def_id::DefId;++use rustc_data_structures::fingerprint::Fingerprint;+use rustc_data_structures::fx::FxHashMap;+use rustc_data_structures::stable_hasher::HashStable;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use std::borrow::Cow;+use std::fmt::Debug;+use std::hash::Hash;++// The parameter `CTX` is required in librustc: implementations may need to access the `'tcx`+// lifetime in `CTX = TyCtxt<'tcx>`.+pub trait QueryConfig<CTX> {+    const NAME: &'static str;+    const CATEGORY: ProfileCategory;++    type Key: Eq + Hash + Clone + Debug;+    type Value: Clone;+}++pub trait QueryContext: DepContext {

This trait probably belongs in librustc_query_system/query/mod.rs.

cjgillot

comment created time in 6 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

+#![feature(bool_to_option)] #![feature(const_fn)] #![feature(const_if_match)] #![feature(const_panic)] #![feature(core_intrinsics)]+#![feature(hash_raw_entry)] #![feature(specialization)] #![feature(stmt_expr_attributes)]+#![feature(vec_remove_item)]  #[macro_use] extern crate log;+#[macro_use]+extern crate rustc_data_structures;  pub mod dep_graph;+pub mod query;  pub trait HashStableContext {     fn debug_dep_tasks(&self) -> bool;

This can be moved to QueryContext.

cjgillot

comment created time in 6 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 macro_rules! is_eval_always { }  macro_rules! query_storage {-    ([][$K:ty, $V:ty]) => {+    (<$tcx:tt>[][$K:ty, $V:ty]) => {

<$tcx:tt> is unused here.

cjgillot

comment created time in 6 days

push eventZoxc/rust

Arkadiusz Piekarz

commit sha b90edfcc9e1c4ff547b012c41ba2d55974794a7e

Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book

view details

Matt Cooper

commit sha ec7010a1a8ae59a7538e649218665497306eb8b1

establish immutable source for RUST_CONFIGURE_ARGS

view details

Matt Cooper

commit sha a942b3946521db46ba653693f5d6e477e39bbb3b

fix how we detect an unset variable

view details

Matt Cooper

commit sha 330233470e74f76731cc6f702302e9978d363285

fix a glaring typo

view details

Nicholas Nethercote

commit sha c54ce496635e0e013e14aa4be5d86c1247f9319a

Remove unused `ModuleConfig::emit_lto_bc` field.

view details

Guillaume Gomez

commit sha 4bf6734f6ffc38745adadd5a8f407630e234685b

clean up E0436 explanation

view details

Nikita Popov

commit sha 841558d3bdc9c9510b841c438838196378741021

Remove trailing newline from llvm-config output

view details

Nikita Popov

commit sha 7a14f9ed4fa60f4d8fc042fc678c80c14a850dc0

Fix LLVM version handling in compiletest Convert version string to integer before comparing. Otherwise we get into trouble with double digit versions ;)

view details

Nikita Popov

commit sha 66008eb9e4e46bb5c12a215e2abe2338617c2582

Adjust data layout in test

view details

Nikita Popov

commit sha a94fa896cc92d5e0678376cf5aa8b64af0899732

Fix timeTraceProfilerInitialize for LLVM 10

view details

Nikita Popov

commit sha 497f879b1e24c369362bcd821959ffabc50a8a31

Update CreateMemSet() usage for LLVM 10

view details

Matt Cooper

commit sha 6db4bb68d18fa371fd2eac1e97f2e2413315ef5d

compat with macOS's ancient Bash

view details

Eduard-Mihai Burtescu

commit sha d8448d2291d39cf5d0b0e814ada1b6e407fa0533

infer: export methods on `InferCtxt` instead of `ShallowResolver`.

view details

Eduard-Mihai Burtescu

commit sha 40f73e74d3d84a1f0ae89a933fa31078850a1b20

traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).

view details

Eduard-Mihai Burtescu

commit sha 78c178bcda3589affb0f4ffa248398cfca08c98f

traits/fulfill: add a couple FIXME comments about potential optimizations.

view details

Wesley Wiser

commit sha 4f405119e8305b26d0ee9e857887d2720b5c5c2a

Resolve worsened debug build codegen

view details

Wesley Wiser

commit sha 61d3be8de784e7ec2642c06daa5ff95f226d65d3

Use Reveal::All in MIR inliner

view details

Bastian Kauschke

commit sha 645fedd183a341b5ab5553d4d35ce9140276371f

correctly handle const params in type_of

view details

Nicholas Nethercote

commit sha d156bf658fd2478ee83d8e86e8c7c46093b74ec8

Remove some local variables. I find the code easier to read if the values in `config` are all used directly, rather than a mix of `config` values and local variables. It will also faciliate some of the following commits. Also, use `config.bitcode_needed()` in one place.

view details

Nicholas Nethercote

commit sha 47c8f3f56babf7830c481cb679f81466c351db7b

Combine `ModuleConfig::embed_bitcode{,_marker}`. Because the `(true, true)` combination isn't valid.

view details

push time in 8 days

pull request commentrust-lang/rust

Decouple `rustc_hir::print` into `rustc_hir_pretty`

The printing stuff isn't quite my wheelhouse.

r? @eddyb

Centril

comment created time in 8 days

pull request commentrust-lang/rust

move `hir_id_validation` to `rustc_passes` + simplify `hir::map` code

@bors r+

Centril

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

+//! The implementation of the query system itself. This defines the macros that+//! generate the actual methods on tcx which find and execute the provider,+//! manage the caches, and so forth.++use crate::dep_graph::DepGraph;+use crate::ty::query::Query;+use crate::ty::tls::{self, ImplicitCtxt};+use crate::ty::{self, TyCtxt};+use rustc_query_system::query::QueryContext;+use rustc_query_system::query::{CycleError, QueryJobId, QueryJobInfo};++use rustc_data_structures::fx::FxHashMap;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::{struct_span_err, Diagnostic, DiagnosticBuilder, Handler, Level};+use rustc_session::Session;+use rustc_span::def_id::DefId;+use rustc_span::Span;++impl QueryContext for TyCtxt<'tcx> {+    type Query = Query<'tcx>;++    fn session(&self) -> &Session {+        &self.sess+    }++    fn def_path_str(&self, def_id: DefId) -> String {+        TyCtxt::def_path_str(*self, def_id)+    }++    fn dep_graph(&self) -> &DepGraph {+        &self.dep_graph+    }++    fn read_query_job<R>(&self, op: impl FnOnce(Option<QueryJobId<Self::DepKind>>) -> R) -> R {

This could just return Option<QueryJobId<Self::DepKind>> and be named current_query_job.

cjgillot

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 impl<'tcx> TyCtxt<'tcx> {          // If `-Zincremental-verify-ich` is specified, re-hash results from         // the cache and make sure that they have the expected fingerprint.-        if unlikely!(self.sess.opts.debugging_opts.incremental_verify_ich) {-            self.incremental_verify_ich::<Q>(&result, dep_node, dep_node_index);+        if unlikely!(tcx.session().opts.debugging_opts.incremental_verify_ich) {+            incremental_verify_ich::<Q, _>(tcx, &result, dep_node, dep_node_index);         }          result     }      #[inline(never)]     #[cold]-    fn incremental_verify_ich<Q: QueryDescription<TyCtxt<'tcx>>>(-        self,+    fn incremental_verify_ich<Q, CTX>(+        tcx: CTX,         result: &Q::Value,-        dep_node: &DepNode<crate::dep_graph::DepKind>,+        dep_node: &DepNode<CTX::DepKind>,         dep_node_index: DepNodeIndex,-    ) {+    )+    where+        CTX: QueryContext,+        Q: QueryDescription<CTX>,+    {         use crate::ich::Fingerprint;          assert!(-            Some(self.dep_graph.fingerprint_of(dep_node_index))-                == self.dep_graph.prev_fingerprint_of(dep_node),+            Some(tcx.dep_graph().fingerprint_of(dep_node_index))+                == tcx.dep_graph().prev_fingerprint_of(dep_node),             "fingerprint for green query instance not loaded from cache: {:?}",             dep_node,         );          debug!("BEGIN verify_ich({:?})", dep_node);-        let mut hcx = self.create_stable_hashing_context();+        let mut hcx = tcx.create_stable_hashing_context();          let new_hash = Q::hash_result(&mut hcx, result).unwrap_or(Fingerprint::ZERO);         debug!("END verify_ich({:?})", dep_node); -        let old_hash = self.dep_graph.fingerprint_of(dep_node_index);+        let old_hash = tcx.dep_graph().fingerprint_of(dep_node_index);          assert!(new_hash == old_hash, "found unstable fingerprints for {:?}", dep_node,);     }      #[inline(always)]-    fn force_query_with_job<Q: QueryDescription<TyCtxt<'tcx>> + 'tcx>(-        self,+    fn force_query_with_job<Q, CTX, K>(+        tcx: CTX,         key: Q::Key,-        job: JobOwner<'tcx, Self, Q::Cache>,-        dep_node: DepNode<crate::dep_graph::DepKind>,-    ) -> (Q::Value, DepNodeIndex) {+        job: JobOwner<'tcx, CTX, Q::Cache>,+        dep_node: DepNode<CTX::DepKind>,+    ) -> (Q::Value, DepNodeIndex)+    where+        Q: QueryDescription<CTX>,+        CTX: QueryContext<DepKind = K>,+        CTX: HashStableContextProvider<<CTX as DepContext>::StableHashingContext>,+        K: DepKind,

Another K parameter that could be removed.

cjgillot

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 impl<'tcx> TyCtxt<'tcx> {          // If `-Zincremental-verify-ich` is specified, re-hash results from         // the cache and make sure that they have the expected fingerprint.-        if unlikely!(self.sess.opts.debugging_opts.incremental_verify_ich) {-            self.incremental_verify_ich::<Q>(&result, dep_node, dep_node_index);+        if unlikely!(tcx.session().opts.debugging_opts.incremental_verify_ich) {

Make incremental_verify_ich and incremental_queries methods on QueryContext to avoid the need for session().

cjgillot

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 impl<'tcx> TyCtxt<'tcx> {                 self.dep_graph.read_index(index);                 value.clone()             },-            |key, lookup| self.try_execute_query::<Q>(span, key, lookup),+            |key, lookup| try_execute_query::<Q, _, _>(self, span, key, lookup),         )     }+}      #[inline(always)]-    fn try_execute_query<Q: QueryDescription<TyCtxt<'tcx>> + 'tcx>(-        self,+    fn try_execute_query<Q, CTX, K>(+        tcx: CTX,         span: Span,         key: Q::Key,         lookup: QueryLookup<             '_,-            TyCtxt<'tcx>,+            CTX,             Q::Key,-            <Q::Cache as QueryCache<TyCtxt<'tcx>>>::Sharded,+            <Q::Cache as QueryCache<CTX>>::Sharded,         >,-    ) -> Q::Value {-        let job = match JobOwner::try_start::<Q, _>(self, span, &key, lookup) {+    ) -> Q::Value+    where+        Q: QueryDescription<CTX>,+        CTX: QueryContext<DepKind = K>,

Here K could be replaced with CTX::DepKind too.

cjgillot

comment created time in 8 days

pull request commentrust-lang/rust

Move the query system to a dedicated crate

@rust-timer build 0d717b485ce2213e0c429a599935baa71c4286ca

cjgillot

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 where     /// This function is inlined because that results in a noticeable speed-up     /// for some compile-time benchmarks.     #[inline(always)]-    fn try_start<'a, 'b, Q>(-        tcx: TyCtxt<'tcx>,+    fn try_start<'a, 'b, Q, K>(+        tcx: CTX,         span: Span,         key: &C::Key,-        mut lookup: QueryLookup<'a, TyCtxt<'tcx>, C::Key, C::Sharded>,-    ) -> TryGetJob<'b, TyCtxt<'tcx>, C>+        mut lookup: QueryLookup<'a, CTX, C::Key, C::Sharded>,+    ) -> TryGetJob<'b, CTX, C>     where-        Q: QueryDescription<TyCtxt<'tcx>, Key = C::Key, Value = C::Value, Cache = C>,+        K: DepKind,

You can replace K with CTX::DepKind here.

cjgillot

comment created time in 8 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 pub(crate) trait QueryCache: Default {     /// It returns the shard index and a lock guard to the shard,     /// which will be used if the query is not in the cache and we need     /// to compute it.-    fn lookup<'tcx, R, GetCache, OnHit, OnMiss>(+    fn lookup<R, GetCache, OnHit, OnMiss>(         &self,-        state: &'tcx QueryState<TyCtxt<'tcx>, Self>,+        state: &QueryState<CTX, Self>,

Can't you just have a CTX: QueryContext parameter on the lookup and complete methods instead?

cjgillot

comment created time in 9 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 use std::borrow::Cow; use std::fmt::Debug; use std::hash::Hash; -// Query configuration and description traits.--// FIXME(eddyb) false positive, the lifetime parameter is used for `Key`/`Value`.-#[allow(unused_lifetimes)]-pub trait QueryConfig<'tcx> {+pub trait QueryConfig<CTX> {

Does plain trait QueryConfig work here?

cjgillot

comment created time in 9 days

Pull request review commentrust-lang/rust

Move the query system to a dedicated crate

 pub mod tls {         TLV.with(|tlv| tlv.get())     } +    impl<'tcx> TlsContext for TyCtxt<'tcx> {

I'd rename this to QueryContext and keep ImplicitCtxt in rustc. Instead use 2 methods to read/write to ImplicitCtxt like DepContext.

cjgillot

comment created time in 9 days

pull request commentrust-lang/rust

Move the query system to a dedicated crate

@bors try @rust-timer queue

cjgillot

comment created time in 9 days

delete branch Zoxc/rust

delete branch : gen-type

delete time in 9 days

push eventZoxc/rust

Guillaume Gomez

commit sha c57de34e8feca218c0c696b621de87c078a2a0e0

Stabilize --crate-version option in rustdoc

view details

Ana-Maria Mihalache

commit sha 7d400199c2b1778ba7fd4748a5cb16d926a85d67

rustc_mir: remove extra space when pretty-printing MIR.

view details

Dylan MacKenzie

commit sha 5b66f27ed34849a849bd93ce662bffeec2e56947

Use `const_eval_limit` instead of infinite loop detector

view details

Dylan MacKenzie

commit sha e15c48672850c0a0b7936df3dfa861bfa34db4bd

Remove infinite loop detector

view details

Dylan MacKenzie

commit sha 044dc6e8dd435eb9c3b6f1dc0c85d0a6e70dae82

Update const-eval tests

view details

Ryan Levick

commit sha f1188f7afe28ae1450faf196da56845af116bf3d

Add test for issue #53275

view details

Felix S. Klock II

commit sha ebf27fac8185ea7a779f4d21ea506377b157fc61

Revised span-to-lines conversion to produce an empty vec on DUMMY_SP. This required revising some of the client code to stop relying on the returned set of lines being non-empty.

view details

Alex Tokarev

commit sha da5d03d09e048771aeec42944bfbef19f96a34cd

Add missing -Z unstable-options flag

view details

Mark Mansi

commit sha 2daaf2b252040ff542eb42d66043f62c360c4db5

replace some adhoc logic with article_and_descr

view details

DeeDeeG

commit sha 99ae42876b1e99b558c392d7912b826d32c39476

Improve E0308 error message wording

view details

mark

commit sha 1661a0a99ba09ff0b2cce8ad99c4f18150165b80

convert a couple more errors

view details

mark

commit sha cdb2c3c36819870e155f4711e67e8b417356c8a4

use static strs

view details

Wonwoo Choi

commit sha 1e5d81de1d8485e9ce2995bc6b1559f25c4d86e5

Fix invalid suggestion on `&mut` iterators yielding `&` references

view details

Ralf Jung

commit sha 82f4a1a9b98ef7f16b25de44150d004c3b1b528a

get rid of ConstPropUnsupported; use ZST marker structs instead

view details

mark

commit sha d40dff9cbbabfdb1477dfbb71f45ca4f36c1d596

the crate and tests

view details

Dylan MacKenzie

commit sha b5636b8437feecc3474e607f60891f3ebc098ded

Rename `TimeLimitReached` -> `StepLimitReached`

view details

CDirkx

commit sha bd1df4405785a34ac494007f185744d51ddd9138

Add regression test for #70155. With #70166 merged, `RangeInclusive` now derives `PartialEq` and `Eq`, implementing structural equality and as a side effect the range is now usable with const generics, closing #70155. A test is added to avoid a change to the private fields or the equality implementation of the range from subtly reverting #70155.

view details

Ralf Jung

commit sha cda81da6ea4c037ef036067d9cb98e80208ee525

avoid unsafe code, use upcasting-trait instead (trick by oli)

view details

mark

commit sha 5e8b795552fed746ec1bbd1d397d7fb11a0faacd

fix one more test

view details

Ralf Jung

commit sha 4803f2946e3de024087d2c847b99ca7faf896135

add err_machine_stop macro

view details

push time in 9 days

Pull request review commentrust-lang/rust

move `hir_id_validation` to `rustc_passes` + simplify `hir::map` code

-use crate::hir::map::Map;-use crate::ty::TyCtxt;+use rustc::hir::map::Map;+use rustc::ty::TyCtxt;

Maybe put this file in a hir folder if you plan to move the collector there too

Centril

comment created time in 9 days

Pull request review commentrust-lang/rust

Avoid query type in generics

 use rustc_errors::{struct_span_err, Diagnostic, DiagnosticBuilder, FatalError, H use rustc_span::source_map::DUMMY_SP; use rustc_span::Span; use std::collections::hash_map::Entry;+use std::convert::TryFrom;+use std::fmt::Debug; use std::hash::{Hash, Hasher}; use std::mem; use std::num::NonZeroU32; use std::ptr; #[cfg(debug_assertions)] use std::sync::atomic::{AtomicUsize, Ordering}; -pub(crate) struct QueryStateShard<'tcx, D: QueryAccessors<'tcx> + ?Sized> {-    pub(super) cache: <<D as QueryAccessors<'tcx>>::Cache as QueryCache<D::Key, D::Value>>::Sharded,-    pub(super) active: FxHashMap<D::Key, QueryResult<'tcx>>,+pub(crate) struct QueryStateShard<'tcx, K, C> {+    cache: C,+    active: FxHashMap<K, QueryResult<'tcx>>,      /// Used to generate unique ids for active jobs.-    pub(super) jobs: u32,+    jobs: u32, } -impl<'tcx, Q: QueryAccessors<'tcx>> QueryStateShard<'tcx, Q> {-    fn get_cache(-        &mut self,-    ) -> &mut <<Q as QueryAccessors<'tcx>>::Cache as QueryCache<Q::Key, Q::Value>>::Sharded {+impl<'tcx, K, C> QueryStateShard<'tcx, K, C> {+    fn get_cache(&mut self) -> &mut C {         &mut self.cache     } } -impl<'tcx, Q: QueryAccessors<'tcx>> Default for QueryStateShard<'tcx, Q> {-    fn default() -> QueryStateShard<'tcx, Q> {+impl<'tcx, K, C: Default> Default for QueryStateShard<'tcx, K, C> {+    fn default() -> QueryStateShard<'tcx, K, C> {         QueryStateShard { cache: Default::default(), active: Default::default(), jobs: 0 }     } } -pub(crate) struct QueryState<'tcx, D: QueryAccessors<'tcx> + ?Sized> {-    pub(super) cache: D::Cache,-    pub(super) shards: Sharded<QueryStateShard<'tcx, D>>,+pub(crate) struct QueryState<'tcx, C: QueryCache> {+    cache: C,+    shards: Sharded<QueryStateShard<'tcx, C::Key, C::Sharded>>,     #[cfg(debug_assertions)]     pub(super) cache_hits: AtomicUsize, } -impl<'tcx, Q: QueryAccessors<'tcx>> QueryState<'tcx, Q> {-    pub(super) fn get_lookup<K: Hash>(&'tcx self, key: &K) -> QueryLookup<'tcx, Q> {+impl<'tcx, C: QueryCache> QueryState<'tcx, C> {+    pub(super) fn get_lookup<K2: Hash>(+        &'tcx self,+        key: &K2,

K2 can now be C::Key.

cjgillot

comment created time in 9 days

Pull request review commentrust-lang/rust

Avoid query type in generics

 use crate::dep_graph::DepNodeIndex;-use crate::ty::query::config::QueryAccessors; use crate::ty::query::plumbing::{QueryLookup, QueryState, QueryStateShard}; use crate::ty::TyCtxt;  use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sharded::Sharded; use std::default::Default; use std::hash::Hash;+use std::marker::PhantomData;  pub(crate) trait CacheSelector<K, V> {-    type Cache: QueryCache<K, V>;+    type Cache: QueryCache<Key = K, Value = V>; } -pub(crate) trait QueryCache<K, V>: Default {+pub(crate) trait QueryCache: Default {+    type Key;+    type Value;     type Sharded: Default;      /// Checks if the query is already computed and in the cache.     /// It returns the shard index and a lock guard to the shard,     /// which will be used if the query is not in the cache and we need     /// to compute it.-    fn lookup<'tcx, R, GetCache, OnHit, OnMiss, Q>(+    fn lookup<'tcx, R, GetCache, OnHit, OnMiss>(         &self,-        state: &'tcx QueryState<'tcx, Q>,+        state: &'tcx QueryState<'tcx, Self>,         get_cache: GetCache,-        key: K,+        key: Self::Key,         // `on_hit` can be called while holding a lock to the query state shard.         on_hit: OnHit,         on_miss: OnMiss,     ) -> R     where-        Q: QueryAccessors<'tcx>,-        GetCache: for<'a> Fn(&'a mut QueryStateShard<'tcx, Q>) -> &'a mut Self::Sharded,-        OnHit: FnOnce(&V, DepNodeIndex) -> R,-        OnMiss: FnOnce(K, QueryLookup<'tcx, Q>) -> R;+        GetCache: for<'a> Fn(+            &'a mut QueryStateShard<'tcx, Self::Key, Self::Sharded>,+        ) -> &'a mut Self::Sharded,+        OnHit: FnOnce(&Self::Value, DepNodeIndex) -> R,+        OnMiss: FnOnce(Self::Key, QueryLookup<'tcx, Self::Key, Self::Sharded>) -> R;      fn complete(         &self,         tcx: TyCtxt<'tcx>,         lock_sharded_storage: &mut Self::Sharded,-        key: K,-        value: V,+        key: Self::Key,+        value: Self::Value,         index: DepNodeIndex,     );      fn iter<R, L>(         &self,         shards: &Sharded<L>,         get_shard: impl Fn(&mut L) -> &mut Self::Sharded,-        f: impl for<'a> FnOnce(Box<dyn Iterator<Item = (&'a K, &'a V, DepNodeIndex)> + 'a>) -> R,+        f: impl for<'a> FnOnce(+            Box<dyn Iterator<Item = (&'a Self::Key, &'a Self::Value, DepNodeIndex)> + 'a>,+        ) -> R,     ) -> R; }  pub struct DefaultCacheSelector;  impl<K: Eq + Hash, V: Clone> CacheSelector<K, V> for DefaultCacheSelector {-    type Cache = DefaultCache;+    type Cache = DefaultCache<K, V>; } -#[derive(Default)]-pub struct DefaultCache;+pub struct DefaultCache<K, V>(PhantomData<(K, V)>);++impl<K, V> Default for DefaultCache<K, V> {+    fn default() -> Self {+        DefaultCache(PhantomData)+    }+} -impl<K: Eq + Hash, V: Clone> QueryCache<K, V> for DefaultCache {+impl<K: Eq + Hash, V: Clone> QueryCache for DefaultCache<K, V> {+    type Key = K;+    type Value = V;     type Sharded = FxHashMap<K, (V, DepNodeIndex)>;      #[inline(always)]-    fn lookup<'tcx, R, GetCache, OnHit, OnMiss, Q>(+    fn lookup<'tcx, R, GetCache, OnHit, OnMiss>(         &self,-        state: &'tcx QueryState<'tcx, Q>,+        state: &'tcx QueryState<'tcx, Self>,         get_cache: GetCache,

Now that you connected up the types, you should be able to just get rid of get_cache: GetCache.

cjgillot

comment created time in 9 days

pull request commentrust-lang/rust

Make the `type_of` return a generic type for generators

@bors r=nikomatsakis

Zoxc

comment created time in 9 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 impl DepGraph {     ///   `arg` parameter.     ///     /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/incremental-compilation.html-    pub fn with_task<'a, C, A, R>(+    pub fn with_task<H, C, A, R>(         &self,-        key: DepNode,+        key: DepNode<K>,         cx: C,         arg: A,         task: fn(C, A) -> R,-        hash_result: impl FnOnce(&mut StableHashingContext<'_>, &R) -> Option<Fingerprint>,+        hash_result: impl FnOnce(&mut H, &R) -> Option<Fingerprint>,     ) -> (R, DepNodeIndex)     where-        C: DepGraphSafe + StableHashingContextProvider<'a>,+        C: DepGraphSafe + HashStableContextProvider<H>,

You can replace DepGraphSafe + HashStableContextProvider<H> with DepContext here and in with_task_impl and with_eval_always_task. Then you could remove both DepGraphSafe and HashStableContextProvider.

cjgillot

comment created time in 9 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@bors r+

cjgillot

comment created time in 9 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@bors r+

cjgillot

comment created time in 10 days

push eventZoxc/rust

Lukas Lueg

commit sha becebf3106407b892f25807473e23d6e8f116a1e

Ammend Rc/Arc::from_raw() docs regarding unsafety Constructing an Rc/Arc is unsafe even if the wrapped `T` is never dereferenced.

view details

Lukas Lueg

commit sha b4c96a9199f13c5c1c2afa6258d2b9206c151d9f

Refine [Arc/Rc]::from_raw() docs

view details

Waffle

commit sha a8340413fe8aa29864ce05875cc63f29af305e31

Remove `finished` flag from `MapWhile`

view details

Lukas Lueg

commit sha 586c7e3907738938db7a6730fd70d7125f5925fa

Make rc::RcBox and sync::ArcInner repr(C) Future-proof these types in case rustc reorders the inner fields. As per discussion in PR #68099.

view details

Waffle

commit sha 605bc1b19b45534b0860fad4b1d44678bc8b34e9

adjuste doc of `map_while` Fix doc of `Iterator::map_while` so it would be clearer that it isn't fused.

view details

Ralf Jung

commit sha 22ee27b266814485fe9ab7da4b539348cb994045

update backtrace crate

view details

Markus Westerlind

commit sha c6f1215d925561021eec296d9e88aa0305d0a18d

perf(dep_graph): Avoid allocating a set on when the number reads are small `reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd` benchmark which I believe is due to the number of reads are very low in many cases (see https://github.com/rust-lang/rust/pull/50565 for instance). This avoids allocating the set until we start allocating the `reads` `SmallVec` but it is possible that a lower limit might be better (not tested since the improvement will be hard to spot either way).

view details

Markus Westerlind

commit sha 4168c25b0f8aadcfe38c8bdae7cc51c22c2f45d1

refactor: Add an alias for the SmallVec in dep_graph

view details

Ralf Jung

commit sha 9552d2e4ab84611e4dd354631cceb9555c956c08

bump backtrace-sys

view details

Tomasz Miąsko

commit sha 24dc2cb133d5b1cdd0680b91e4295039d704a610

librustc_codegen_llvm: Replace deprecated API usage

view details

Josh Stone

commit sha 71f5aed385b390dc53f8974092d5c7fd9a1ca634

Rename add_lib_path to add_dylib_path

view details

Josh Stone

commit sha 0536b8dcaafcfc0e51713a05eb0082a6e20725b1

Ensure LLVM is in the link path for rustc tools

view details

Josh Stone

commit sha e1a6a306ad4f7bf6fe771b2a9d3362a991eb5ce1

Revert "Fix missing libLLVM.so in stage0 sysroot." This reverts commit 8b9c5396ca574fad9cc7b51d16c8c96e0ae74632.

view details

flip1995

commit sha 2b3168ce5f2be26379d16683ec081d4619f66454

Update Clippy

view details

Alex Crichton

commit sha d1a4a57777331143e5a6de1e8b06f26b27c8eb61

Update the bundled wasi-libc with libstd Brings in WebAssembly/wasi-libc#184 which can help standalone programs with environment variables!

view details

Josh Stone

commit sha 3a2a4429a288031e7810e84b35ff13b8dd4608a4

Avoid llvm-config in more situations, like bootstrap test runs

view details

Eduard-Mihai Burtescu

commit sha 6f6fe38b19339265397fc199c61df37772bef54c

parse/lexer: support `StringReader::retokenize` called on external files.

view details

Felix S. Klock II

commit sha 3db6d1cc168d6a2be8048c34012526af1ec24213

For issue 53957: revise unit tests to focus on underlying bug of 23076. Namely, this version focuses on the end-to-end behavior that the attempt to create the UDP binding will fail, regardless of the semantics of how particular DNS servers handle junk inputs. (I spent some time trying to create a second more-focused test that would sidestep the DNS resolution, but this is not possible without more invasive changes to the internal infrastructure of `ToSocketAddrs` and what not. It is not worth it.)

view details

hatoo

commit sha 61ef72fe4951148e3987af21ee76ace6745c8a62

Use getentropy(2) on macos

view details

Vadim Petrochenkov

commit sha 13dd9aff64a9730574188b373d63dadc719f73b6

ast: Compress `AttrId` from `usize` to `u32` Also stop encoding/decoding it entirely

view details

push time in 10 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@bors r-

cjgillot

comment created time in 10 days

push eventZoxc/rust

Lukas Lueg

commit sha becebf3106407b892f25807473e23d6e8f116a1e

Ammend Rc/Arc::from_raw() docs regarding unsafety Constructing an Rc/Arc is unsafe even if the wrapped `T` is never dereferenced.

view details

Lukas Lueg

commit sha b4c96a9199f13c5c1c2afa6258d2b9206c151d9f

Refine [Arc/Rc]::from_raw() docs

view details

Waffle

commit sha a8340413fe8aa29864ce05875cc63f29af305e31

Remove `finished` flag from `MapWhile`

view details

Lukas Lueg

commit sha 586c7e3907738938db7a6730fd70d7125f5925fa

Make rc::RcBox and sync::ArcInner repr(C) Future-proof these types in case rustc reorders the inner fields. As per discussion in PR #68099.

view details

Waffle

commit sha 605bc1b19b45534b0860fad4b1d44678bc8b34e9

adjuste doc of `map_while` Fix doc of `Iterator::map_while` so it would be clearer that it isn't fused.

view details

Ralf Jung

commit sha 22ee27b266814485fe9ab7da4b539348cb994045

update backtrace crate

view details

Markus Westerlind

commit sha c6f1215d925561021eec296d9e88aa0305d0a18d

perf(dep_graph): Avoid allocating a set on when the number reads are small `reserve_and_rehash` takes up 1.4% of the runtime on the `packed-simd` benchmark which I believe is due to the number of reads are very low in many cases (see https://github.com/rust-lang/rust/pull/50565 for instance). This avoids allocating the set until we start allocating the `reads` `SmallVec` but it is possible that a lower limit might be better (not tested since the improvement will be hard to spot either way).

view details

Markus Westerlind

commit sha 4168c25b0f8aadcfe38c8bdae7cc51c22c2f45d1

refactor: Add an alias for the SmallVec in dep_graph

view details

Ralf Jung

commit sha 9552d2e4ab84611e4dd354631cceb9555c956c08

bump backtrace-sys

view details

Oliver Scherer

commit sha cdc730457e9030feaf8c4376a668a9ef61c7f189

Compute the correct layout for variants of uninhabited enums and readd a long lost assertion This reverts part of commit 9712fa405944cb8d5416556ac4b1f26365a10658.

view details

Oliver Scherer

commit sha ec88ffa38cee51fa7290aa6c99d928ffe346ca6c

Comment nits Co-Authored-By: Ralf Jung <post@ralfj.de>

view details

Oliver Scherer

commit sha 74608c7f206171cb72c020a03800b2d9035a35fa

Rustfmt and adjust capitalization

view details

Andreas Jonson

commit sha afa940b900c2003228ea7f5d9f8d78906d84c135

Update the mir inline costs handle that when mir is lowered to llvm-ir more code is generated. landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions.

view details

Tomasz Miąsko

commit sha 24dc2cb133d5b1cdd0680b91e4295039d704a610

librustc_codegen_llvm: Replace deprecated API usage

view details

David Wood

commit sha bee151308d5c5090627772c04e17f783aa53451a

codegen/mir: support polymorphic `InstanceDef`s This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <david@davidtw.co>

view details

Ralf Jung

commit sha 058ff728dc2a16b44c8abad2581287743c828270

debug-assert ptr sanity in ptr::write

view details

Ralf Jung

commit sha 59350e4ae25ce9b82ca8b088a63b58c32e22449c

increase slack for stack size test

view details

Ralf Jung

commit sha 139a8c34bc40d3d30c31ffb4c0908b3511237ee7

fix a codegen test

view details

Camille GILLOT

commit sha 0bf5cae489e828a6678cab5144e638ae909d7b93

Remove __query_compute module.

view details

Camille GILLOT

commit sha fc82376bc437d4494832b171d924e2f116174578

Make QueryAccessor::dep_kind an associated const.

view details

push time in 10 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@rust-timer build 58d0a1d56d4673460d709a833927697c227246f3

cjgillot

comment created time in 10 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@bors p=1 r+

cjgillot

comment created time in 10 days

pull request commentrust-lang/rust

Liberate `rustc_ast_lowering` from `rustc`

That's an unexpected perf result :/

@bors r+

Centril

comment created time in 10 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 pub fn force_from_dep_node<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> bool      false }++pub(crate) fn try_load_from_on_disk_cache<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) {+    use crate::dep_graph::DepKind;

Move this to the start of the file.

cjgillot

comment created time in 10 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 impl<'tcx> DepContext for TyCtxt<'tcx> {      // Interactions with on_disk_cache     fn try_load_from_on_disk_cache(&self, dep_node: &DepNode) {-        use crate::mir::interpret::GlobalId;-        use crate::ty::query::queries;-        use crate::ty::query::QueryDescription;-        rustc_dep_node_try_load_from_on_disk_cache!(dep_node, *self)+        use crate::ty::query::try_load_from_on_disk_cache;

Move this to the start of the file.

cjgillot

comment created time in 10 days

pull request commentrust-lang/rust

Avoid duplicating code for each query

@rust-timer build d5a581b4e2aad68744b0a6138de00c4a572a1b85

cjgillot

comment created time in 11 days

pull request commentrust-lang/rust

Liberate `rustc_ast_lowering` from `rustc`

r=me if perf is fine

Centril

comment created time in 11 days

pull request commentrust-lang/rust

Liberate `rustc_ast_lowering` from `rustc`

@bors try @rust-timer queue

Centril

comment created time in 11 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

@bors try @rust-timer queue

cjgillot

comment created time in 11 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 impl DepGraph {                     node: Some(_key),                     reads: SmallVec::new(),                     read_set: Default::default(),+                    phantom_data: std::marker::PhantomData,

Import std::marker::PhantomData so this can just be PhantomData.

cjgillot

comment created time in 11 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

-use crate::ty::{self, TyCtxt};-use parking_lot::{Condvar, Mutex};+use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::profiling::QueryInvocationId; use rustc_data_structures::sharded::{self, Sharded}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::sync::{AtomicU32, AtomicU64, Lock, Lrc, Ordering};+use rustc_data_structures::unlikely; use rustc_errors::Diagnostic;-use rustc_hir::def_id::DefId; use rustc_index::vec::{Idx, IndexVec};-use smallvec::SmallVec;++use parking_lot::{Condvar, Mutex};+use smallvec::{smallvec, SmallVec}; use std::collections::hash_map::Entry; use std::env; use std::hash::Hash; use std::mem;+use std::panic as bug;

Just replace bug! with panic!.

cjgillot

comment created time in 11 days

push eventZoxc/rust

Waffle

commit sha a8340413fe8aa29864ce05875cc63f29af305e31

Remove `finished` flag from `MapWhile`

view details

Waffle

commit sha 605bc1b19b45534b0860fad4b1d44678bc8b34e9

adjuste doc of `map_while` Fix doc of `Iterator::map_while` so it would be clearer that it isn't fused.

view details

Ralf Jung

commit sha 22ee27b266814485fe9ab7da4b539348cb994045

update backtrace crate

view details

Ralf Jung

commit sha 9552d2e4ab84611e4dd354631cceb9555c956c08

bump backtrace-sys

view details

flip1995

commit sha 2b3168ce5f2be26379d16683ec081d4619f66454

Update Clippy

view details

Felix S. Klock II

commit sha 3db6d1cc168d6a2be8048c34012526af1ec24213

For issue 53957: revise unit tests to focus on underlying bug of 23076. Namely, this version focuses on the end-to-end behavior that the attempt to create the UDP binding will fail, regardless of the semantics of how particular DNS servers handle junk inputs. (I spent some time trying to create a second more-focused test that would sidestep the DNS resolution, but this is not possible without more invasive changes to the internal infrastructure of `ToSocketAddrs` and what not. It is not worth it.)

view details

Vadim Petrochenkov

commit sha 13dd9aff64a9730574188b373d63dadc719f73b6

ast: Compress `AttrId` from `usize` to `u32` Also stop encoding/decoding it entirely

view details

Marti Raudsepp

commit sha 1d004bddee33fcae51611b0a83569052692ce15b

Fix deprecated Error.description() usage in docs

view details

Wesley Wiser

commit sha 2fa550b85d6d3faed9ab7fbf442ac3b11b380184

Fix ICE caused by truncating a negative ZST enum discriminant

view details

Wesley Wiser

commit sha 96bbd1ccb6c210318d5ba90e7b68430b643e470a

Rename `cast_from_int` to `cast_from_int_like`

view details

Eduard-Mihai Burtescu

commit sha 14e0aad9909d35195c5725962a4c97697235759d

symbol_names: treat ReifyShim like VtableShim.

view details

Stein Somers

commit sha d8a136fa10edb5614b1a2f311d1aa05c206a65d5

Test pretty printing more and fix overzealous type substitution

view details

lzutao

commit sha a39e96407a579abbf4c273dc41692b69717b2aa8

Remove CARGO_BUILD_TARGET from bootstrap.py

view details

Waffle

commit sha e964d7180ca4164dfa3d6c6dee6026889c604812

slightly change the `Iterator::map_while` docs

view details

Nixon Enraght-Moony

commit sha 97aa2704ec109002b513b99e925c891bc8461217

Add explanation message for E0224

view details

adrian5

commit sha 0b307f7a9f00878325f8c2c2573ea49e7a9c4353

Tweak wording for std::io::Read::read function

view details

bors

commit sha 38114ff16e7856f98b2b4be7ab4cd29b38bed59a

Auto merge of #69729 - RalfJung:backtrace, r=Mark-Simulacrum update backtrace crate In particular this release includes https://github.com/rust-lang/backtrace-rs/pull/297 and https://github.com/rust-lang/backtrace-rs/pull/300.

view details

Vadim Petrochenkov

commit sha e391d776e3869f56ca1467a4c7e3469080c5378d

Add a test for out-of-line module passed through a proc macro

view details

John Kåre Alsaker

commit sha 0aa15d048573d4fd0453e1da301857d7ca1faf7f

Allow `hir().find` to return `None`

view details

Dylan DPC

commit sha 834ed36a532381aac4cb23d607e6522dff0ca244

Rollup merge of #70003 - eddyb:symbol-mangling-reify-shims, r=nikomatsakis symbol_names: treat ReifyShim like VtableShim. Without this, the `#[track_caller]` tests don't pass with `-Zsymbol-mangling-version=v0`, because there is a symbol name collision between the `ReifyShim` and the original definition. cc @anp

view details

push time in 11 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

-pub mod debug;+use crate::ich::StableHashingContext;+use crate::ty::{self, TyCtxt};+use rustc_data_structures::profiling::SelfProfilerRef;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use rustc_hir::def_id::DefId;+ mod dep_node;-mod graph;-mod prev;-mod query; mod safe;-mod serialized;--pub(crate) use self::dep_node::DepNodeParams;-pub use self::dep_node::{label_strs, DepConstructor, DepKind, DepNode, WorkProductId};-pub use self::graph::WorkProductFileKind;-pub use self::graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};-pub use self::prev::PreviousDepGraph;-pub use self::query::DepGraphQuery;-pub use self::safe::AssertDepGraphSafe;-pub use self::safe::DepGraphSafe;-pub use self::serialized::{SerializedDepGraph, SerializedDepNodeIndex};++pub(crate) use rustc_query_system::dep_graph::DepNodeParams;+pub use rustc_query_system::dep_graph::{+    debug, hash_result, DepContext, DepNodeColor, DepNodeIndex, SerializedDepNodeIndex,+    WorkProduct, WorkProductFileKind, WorkProductId,+};++pub use dep_node::{label_strs, DepConstructor, DepKind, DepNode, DepNodeExt};+pub use safe::AssertDepGraphSafe;+pub use safe::DepGraphSafe;++pub type DepGraph = rustc_query_system::dep_graph::DepGraph<DepKind>;+pub type TaskDeps = rustc_query_system::dep_graph::TaskDeps<DepKind>;+pub type DepGraphQuery = rustc_query_system::dep_graph::DepGraphQuery<DepKind>;+pub type PreviousDepGraph = rustc_query_system::dep_graph::PreviousDepGraph<DepKind>;+pub type SerializedDepGraph = rustc_query_system::dep_graph::SerializedDepGraph<DepKind>;++impl rustc_query_system::dep_graph::DepKind for DepKind {+    fn is_eval_always(&self) -> bool {+        DepKind::is_eval_always(self)+    }++    fn has_params(&self) -> bool {+        DepKind::has_params(self)+    }++    fn debug_node(node: &DepNode, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+        write!(f, "{:?}", node.kind)?;++        if !node.kind.has_params() && !node.kind.is_anon() {+            return Ok(());+        }++        write!(f, "(")?;++        ty::tls::with_opt(|opt_tcx| {+            if let Some(tcx) = opt_tcx {+                if let Some(def_id) = node.extract_def_id(tcx) {+                    write!(f, "{}", tcx.def_path_debug_str(def_id))?;+                } else if let Some(ref s) = tcx.dep_graph.dep_node_debug_str(*node) {+                    write!(f, "{}", s)?;+                } else {+                    write!(f, "{}", node.hash)?;+                }+            } else {+                write!(f, "{}", node.hash)?;+            }+            Ok(())+        })?;++        write!(f, ")")+    }++    fn with_deps<OP, R>(task_deps: Option<&Lock<TaskDeps>>, op: OP) -> R+    where+        OP: FnOnce() -> R,+    {+        ty::tls::with_context(|icx| {+            let icx = ty::tls::ImplicitCtxt { task_deps, ..icx.clone() };++            ty::tls::enter_context(&icx, |_| op())+        })+    }++    fn read_deps<OP>(op: OP) -> ()+    where+        OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps>>) -> (),+    {+        ty::tls::with_context_opt(|icx| {+            let icx = if let Some(icx) = icx { icx } else { return };+            op(icx.task_deps)+        })+    }+}++impl<'tcx> DepContext for TyCtxt<'tcx> {+    type DepKind = DepKind;+    type StableHashingContext = StableHashingContext<'tcx>;++    fn create_stable_hashing_context(&self) -> Self::StableHashingContext {+        TyCtxt::create_stable_hashing_context(*self)+    }++    fn try_force_previous_green(&self, dep_dep_node: &DepNode) -> bool {+        // FIXME: This match is just a workaround for incremental bugs and should+        // be removed. https://github.com/rust-lang/rust/issues/62649 is one such+        // bug that must be fixed before removing this.+        match dep_dep_node.kind {+            DepKind::hir_owner | DepKind::hir_owner_nodes | DepKind::CrateMetadata => {+                if let Some(def_id) = dep_dep_node.extract_def_id(*self) {+                    if def_id_corresponds_to_hir_dep_node(*self, def_id) {+                        if dep_dep_node.kind == DepKind::CrateMetadata {+                            // The `DefPath` has corresponding node,+                            // and that node should have been marked+                            // either red or green in `data.colors`.+                            bug!(+                                "DepNode {:?} should have been \+                             pre-marked as red or green but wasn't.",+                                dep_dep_node+                            );+                        }+                    } else {+                        // This `DefPath` does not have a+                        // corresponding `DepNode` (e.g. a+                        // struct field), and the ` DefPath`+                        // collided with the `DefPath` of a+                        // proper item that existed in the+                        // previous compilation session.+                        //+                        // Since the given `DefPath` does not+                        // denote the item that previously+                        // existed, we just fail to mark green.+                        return false;+                    }+                } else {+                    // If the node does not exist anymore, we+                    // just fail to mark green.+                    return false;+                }+            }+            _ => {+                // For other kinds of nodes it's OK to be+                // forced.+            }+        }++        debug!("try_force_previous_green({:?}) --- trying to force", dep_dep_node);+        ty::query::force_from_dep_node(*self, dep_dep_node)+    }++    fn has_errors_or_delayed_span_bugs(&self) -> bool {+        self.sess.has_errors_or_delayed_span_bugs()+    }++    fn diagnostic(&self) -> &rustc_errors::Handler {+        self.sess.diagnostic()+    }++    // Interactions with on_disk_cache+    fn try_load_from_on_disk_cache(&self, dep_node: &DepNode) {+        use crate::mir::interpret::GlobalId;+        use crate::ty::query::queries;+        use crate::ty::query::QueryDescription;+        rustc_dep_node_try_load_from_on_disk_cache!(dep_node, *self)

I'd like this macro to be expanded in src\librustc\query\mod.rs so it's in the same location as the query definitions. So just copy this function there.

cjgillot

comment created time in 11 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

-pub mod debug;+use crate::ich::StableHashingContext;+use crate::ty::{self, TyCtxt};+use rustc_data_structures::profiling::SelfProfilerRef;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use rustc_hir::def_id::DefId;+ mod dep_node;-mod graph;-mod prev;-mod query; mod safe;-mod serialized;--pub(crate) use self::dep_node::DepNodeParams;-pub use self::dep_node::{label_strs, DepConstructor, DepKind, DepNode, WorkProductId};-pub use self::graph::WorkProductFileKind;-pub use self::graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};-pub use self::prev::PreviousDepGraph;-pub use self::query::DepGraphQuery;-pub use self::safe::AssertDepGraphSafe;-pub use self::safe::DepGraphSafe;-pub use self::serialized::{SerializedDepGraph, SerializedDepNodeIndex};++pub(crate) use rustc_query_system::dep_graph::DepNodeParams;+pub use rustc_query_system::dep_graph::{+    debug, hash_result, DepContext, DepNodeColor, DepNodeIndex, SerializedDepNodeIndex,+    WorkProduct, WorkProductFileKind, WorkProductId,+};++pub use dep_node::{label_strs, DepConstructor, DepKind, DepNode, DepNodeExt};+pub use safe::AssertDepGraphSafe;+pub use safe::DepGraphSafe;++pub type DepGraph = rustc_query_system::dep_graph::DepGraph<DepKind>;+pub type TaskDeps = rustc_query_system::dep_graph::TaskDeps<DepKind>;+pub type DepGraphQuery = rustc_query_system::dep_graph::DepGraphQuery<DepKind>;+pub type PreviousDepGraph = rustc_query_system::dep_graph::PreviousDepGraph<DepKind>;+pub type SerializedDepGraph = rustc_query_system::dep_graph::SerializedDepGraph<DepKind>;++impl rustc_query_system::dep_graph::DepKind for DepKind {+    fn is_eval_always(&self) -> bool {+        DepKind::is_eval_always(self)+    }++    fn has_params(&self) -> bool {+        DepKind::has_params(self)+    }++    fn debug_node(node: &DepNode, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+        write!(f, "{:?}", node.kind)?;++        if !node.kind.has_params() && !node.kind.is_anon() {+            return Ok(());+        }++        write!(f, "(")?;++        ty::tls::with_opt(|opt_tcx| {+            if let Some(tcx) = opt_tcx {+                if let Some(def_id) = node.extract_def_id(tcx) {+                    write!(f, "{}", tcx.def_path_debug_str(def_id))?;+                } else if let Some(ref s) = tcx.dep_graph.dep_node_debug_str(*node) {+                    write!(f, "{}", s)?;+                } else {+                    write!(f, "{}", node.hash)?;+                }+            } else {+                write!(f, "{}", node.hash)?;+            }+            Ok(())+        })?;++        write!(f, ")")+    }++    fn with_deps<OP, R>(task_deps: Option<&Lock<TaskDeps>>, op: OP) -> R+    where+        OP: FnOnce() -> R,+    {+        ty::tls::with_context(|icx| {+            let icx = ty::tls::ImplicitCtxt { task_deps, ..icx.clone() };++            ty::tls::enter_context(&icx, |_| op())+        })+    }++    fn read_deps<OP>(op: OP) -> ()+    where+        OP: for<'a> FnOnce(Option<&'a Lock<TaskDeps>>) -> (),+    {+        ty::tls::with_context_opt(|icx| {+            let icx = if let Some(icx) = icx { icx } else { return };+            op(icx.task_deps)+        })+    }+}++impl<'tcx> DepContext for TyCtxt<'tcx> {+    type DepKind = DepKind;+    type StableHashingContext = StableHashingContext<'tcx>;++    fn create_stable_hashing_context(&self) -> Self::StableHashingContext {+        TyCtxt::create_stable_hashing_context(*self)+    }++    fn try_force_previous_green(&self, dep_dep_node: &DepNode) -> bool {

Maybe just call this try_force_from_dep_node. The dep_dep_node parameter should be renamed to dep_node.

cjgillot

comment created time in 11 days

delete branch Zoxc/rust

delete branch : opt-find

delete time in 11 days

pull request commentrust-lang/rust

Allow `hir().find` to return `None`

@bors r=eddyb

Zoxc

comment created time in 12 days

pull request commentrust-lang/rust

Avoid duplicating code for each query

@cjgillot I'd leave that for a future PR.

@bors try @rust-timer queue

cjgillot

comment created time in 12 days

push eventZoxc/rust

Oliver Scherer

commit sha cdc730457e9030feaf8c4376a668a9ef61c7f189

Compute the correct layout for variants of uninhabited enums and readd a long lost assertion This reverts part of commit 9712fa405944cb8d5416556ac4b1f26365a10658.

view details

Oliver Scherer

commit sha ec88ffa38cee51fa7290aa6c99d928ffe346ca6c

Comment nits Co-Authored-By: Ralf Jung <post@ralfj.de>

view details

Oliver Scherer

commit sha 74608c7f206171cb72c020a03800b2d9035a35fa

Rustfmt and adjust capitalization

view details

Andreas Jonson

commit sha afa940b900c2003228ea7f5d9f8d78906d84c135

Update the mir inline costs handle that when mir is lowered to llvm-ir more code is generated. landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions.

view details

David Wood

commit sha bee151308d5c5090627772c04e17f783aa53451a

codegen/mir: support polymorphic `InstanceDef`s This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <david@davidtw.co>

view details

Ralf Jung

commit sha 058ff728dc2a16b44c8abad2581287743c828270

debug-assert ptr sanity in ptr::write

view details

Ralf Jung

commit sha 59350e4ae25ce9b82ca8b088a63b58c32e22449c

increase slack for stack size test

view details

Ralf Jung

commit sha 139a8c34bc40d3d30c31ffb4c0908b3511237ee7

fix a codegen test

view details

Camille GILLOT

commit sha 0bf5cae489e828a6678cab5144e638ae909d7b93

Remove __query_compute module.

view details

Camille GILLOT

commit sha fc82376bc437d4494832b171d924e2f116174578

Make QueryAccessor::dep_kind an associated const.

view details

Camille GILLOT

commit sha cf238fd057651371731fde47a2ebf251bf37cfb5

Inline QueryAccessor::query.

view details

Camille GILLOT

commit sha 1249032aabe3a0a80c0a852ef803702d7fb70d21

Move impl of Queries with its definition.

view details

Camille GILLOT

commit sha b08943358ec8adc2d8e542659c7dcd2514311918

Unpack type arguments for QueryStateShard.

view details

Camille GILLOT

commit sha 486a082c58c60959328e0b394f9e58850b3c6341

Unpack type arguments for QueryLookup.

view details

Camille GILLOT

commit sha a0f57e24e35a365d9d55f37611edfc6666b5d3c9

Unpack type arguments for QueryState.

view details

Camille GILLOT

commit sha fa02dca428314676716c78b5aa1953eea1627bf0

Remove Q parameter from QueryCache::lookup.

view details

Camille GILLOT

commit sha a18aa81bd8dd3012e43f195c52b8113a74479056

Remove Q parameter from alloc_self_profile_query_strings_for_query_cache.

view details

Camille GILLOT

commit sha d125bbb12b9b1839068706834d350acf5a91244c

Remove Q parameter from query stats.

view details

Camille GILLOT

commit sha fa0794db239d588b5822233d32fa7aa82bd17069

Remove Q parameter from JobOwner.

view details

Camille GILLOT

commit sha 5dc7c2ed1aab0c6b0bfb15b4fb5a4d079d3aaa36

Remove Q parameter from try_get_cached.

view details

push time in 12 days

delete branch Zoxc/rust

delete branch : metadata-prefetch

delete time in 12 days

delete branch Zoxc/rust

delete branch : ast-fragment-error

delete time in 12 days

push eventZoxc/rust

Oliver Scherer

commit sha cdc730457e9030feaf8c4376a668a9ef61c7f189

Compute the correct layout for variants of uninhabited enums and readd a long lost assertion This reverts part of commit 9712fa405944cb8d5416556ac4b1f26365a10658.

view details

Oliver Scherer

commit sha ec88ffa38cee51fa7290aa6c99d928ffe346ca6c

Comment nits Co-Authored-By: Ralf Jung <post@ralfj.de>

view details

Oliver Scherer

commit sha 74608c7f206171cb72c020a03800b2d9035a35fa

Rustfmt and adjust capitalization

view details

Andreas Jonson

commit sha afa940b900c2003228ea7f5d9f8d78906d84c135

Update the mir inline costs handle that when mir is lowered to llvm-ir more code is generated. landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions.

view details

David Wood

commit sha bee151308d5c5090627772c04e17f783aa53451a

codegen/mir: support polymorphic `InstanceDef`s This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <david@davidtw.co>

view details

Ralf Jung

commit sha 058ff728dc2a16b44c8abad2581287743c828270

debug-assert ptr sanity in ptr::write

view details

Ralf Jung

commit sha 59350e4ae25ce9b82ca8b088a63b58c32e22449c

increase slack for stack size test

view details

Ralf Jung

commit sha 139a8c34bc40d3d30c31ffb4c0908b3511237ee7

fix a codegen test

view details

Camille GILLOT

commit sha 0bf5cae489e828a6678cab5144e638ae909d7b93

Remove __query_compute module.

view details

Camille GILLOT

commit sha fc82376bc437d4494832b171d924e2f116174578

Make QueryAccessor::dep_kind an associated const.

view details

Camille GILLOT

commit sha cf238fd057651371731fde47a2ebf251bf37cfb5

Inline QueryAccessor::query.

view details

Camille GILLOT

commit sha 1249032aabe3a0a80c0a852ef803702d7fb70d21

Move impl of Queries with its definition.

view details

Camille GILLOT

commit sha b08943358ec8adc2d8e542659c7dcd2514311918

Unpack type arguments for QueryStateShard.

view details

Camille GILLOT

commit sha 486a082c58c60959328e0b394f9e58850b3c6341

Unpack type arguments for QueryLookup.

view details

Camille GILLOT

commit sha a0f57e24e35a365d9d55f37611edfc6666b5d3c9

Unpack type arguments for QueryState.

view details

Camille GILLOT

commit sha fa02dca428314676716c78b5aa1953eea1627bf0

Remove Q parameter from QueryCache::lookup.

view details

Camille GILLOT

commit sha a18aa81bd8dd3012e43f195c52b8113a74479056

Remove Q parameter from alloc_self_profile_query_strings_for_query_cache.

view details

Camille GILLOT

commit sha d125bbb12b9b1839068706834d350acf5a91244c

Remove Q parameter from query stats.

view details

Camille GILLOT

commit sha fa0794db239d588b5822233d32fa7aa82bd17069

Remove Q parameter from JobOwner.

view details

Camille GILLOT

commit sha 5dc7c2ed1aab0c6b0bfb15b4fb5a4d079d3aaa36

Remove Q parameter from try_get_cached.

view details

push time in 12 days

push eventZoxc/rust

Oliver Scherer

commit sha cdc730457e9030feaf8c4376a668a9ef61c7f189

Compute the correct layout for variants of uninhabited enums and readd a long lost assertion This reverts part of commit 9712fa405944cb8d5416556ac4b1f26365a10658.

view details

Oliver Scherer

commit sha ec88ffa38cee51fa7290aa6c99d928ffe346ca6c

Comment nits Co-Authored-By: Ralf Jung <post@ralfj.de>

view details

Oliver Scherer

commit sha 74608c7f206171cb72c020a03800b2d9035a35fa

Rustfmt and adjust capitalization

view details

Andreas Jonson

commit sha afa940b900c2003228ea7f5d9f8d78906d84c135

Update the mir inline costs handle that when mir is lowered to llvm-ir more code is generated. landingpads generates 10 llvm-ir instructions and resume 9 llvm-ir instructions.

view details

David Wood

commit sha bee151308d5c5090627772c04e17f783aa53451a

codegen/mir: support polymorphic `InstanceDef`s This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <david@davidtw.co>

view details

Ralf Jung

commit sha 058ff728dc2a16b44c8abad2581287743c828270

debug-assert ptr sanity in ptr::write

view details

Ralf Jung

commit sha 59350e4ae25ce9b82ca8b088a63b58c32e22449c

increase slack for stack size test

view details

Ralf Jung

commit sha 139a8c34bc40d3d30c31ffb4c0908b3511237ee7

fix a codegen test

view details

Camille GILLOT

commit sha 0bf5cae489e828a6678cab5144e638ae909d7b93

Remove __query_compute module.

view details

Camille GILLOT

commit sha fc82376bc437d4494832b171d924e2f116174578

Make QueryAccessor::dep_kind an associated const.

view details

Camille GILLOT

commit sha cf238fd057651371731fde47a2ebf251bf37cfb5

Inline QueryAccessor::query.

view details

Camille GILLOT

commit sha 1249032aabe3a0a80c0a852ef803702d7fb70d21

Move impl of Queries with its definition.

view details

Camille GILLOT

commit sha b08943358ec8adc2d8e542659c7dcd2514311918

Unpack type arguments for QueryStateShard.

view details

Camille GILLOT

commit sha 486a082c58c60959328e0b394f9e58850b3c6341

Unpack type arguments for QueryLookup.

view details

Camille GILLOT

commit sha a0f57e24e35a365d9d55f37611edfc6666b5d3c9

Unpack type arguments for QueryState.

view details

Camille GILLOT

commit sha fa02dca428314676716c78b5aa1953eea1627bf0

Remove Q parameter from QueryCache::lookup.

view details

Camille GILLOT

commit sha a18aa81bd8dd3012e43f195c52b8113a74479056

Remove Q parameter from alloc_self_profile_query_strings_for_query_cache.

view details

Camille GILLOT

commit sha d125bbb12b9b1839068706834d350acf5a91244c

Remove Q parameter from query stats.

view details

Camille GILLOT

commit sha fa0794db239d588b5822233d32fa7aa82bd17069

Remove Q parameter from JobOwner.

view details

Camille GILLOT

commit sha 5dc7c2ed1aab0c6b0bfb15b4fb5a4d079d3aaa36

Remove Q parameter from try_get_cached.

view details

push time in 12 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

+pub mod debug;+mod dep_node;+mod graph;+mod prev;+mod query;+mod safe;+mod serialized;++pub use dep_node::{DepNode, DepNodeParams, WorkProductId};+pub use graph::WorkProductFileKind;+pub use graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};+pub use prev::PreviousDepGraph;+pub use query::DepGraphQuery;+pub use safe::AssertDepGraphSafe;+pub use safe::DepGraphSafe;+pub use serialized::{SerializedDepGraph, SerializedDepNodeIndex};++use rustc_data_structures::profiling::SelfProfilerRef;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use rustc_hir::def_id::DefId;++use std::fmt;+use std::hash::Hash;++pub trait DepContext: Copy {+    type DepKind: self::DepKind;+    type StableHashingContext: crate::HashStableContext;++    /// Create a hashing context for hashing new results.+    fn create_stable_hashing_context(&self) -> Self::StableHashingContext;++    /// Try to force a dep node to execute and see if it's green.+    fn try_force_previous_green(&self, node: &DepNode<Self::DepKind>) -> bool;++    /// Extracts the DefId corresponding to this DepNode. This will work+    /// if two conditions are met:+    ///+    /// 1. The Fingerprint of the DepNode actually is a DefPathHash, and+    /// 2. the item that the DefPath refers to exists in the current tcx.+    ///+    /// Condition (1) is determined by the DepKind variant of the+    /// DepNode. Condition (2) might not be fulfilled if a DepNode+    /// refers to something from the previous compilation session that+    /// has been removed.+    fn extract_def_id(&self, node: &DepNode<Self::DepKind>) -> Option<DefId>;

This seems to be unused. You can remove it along with the rustc_hir and rustc_ast dependencies of the rustc_query_system crate.

cjgillot

comment created time in 12 days

push eventZoxc/rust

Tim Vermeulen

commit sha 14bcf0aaa51138afdd95190d814f4b46013f990e

Fix Peekable::next_back

view details

Tim Vermeulen

commit sha 16a23e72d05b0e3cb48f0a5442e651725bf27ae8

Fuse FlattenCompat's inner iterator

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

Nicholas Nethercote

commit sha 54d1c50c7e7b4c4c7dca6c85c6965c886922b449

Remove `sip::Hasher::short_write`. `sip::Hasher::short_write` is currently unused. It is called by `sip::Hasher::write_{u8,usize}`, but those methods are also unused, because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement any of the `write_xyz` methods, so all their write operations end up calling `sip::Hasher::write`. (I confirmed this by inserting a `panic!` in `sip::Hasher::short_write` and running the tests -- they all passed.) The alternative would be to add all the missing `write_xyz` methods. This does give some significant speed-ups, but it hurts compile times a little in some cases. See #69152 for details. This commit does the conservative thing and doesn't change existing behaviour.

view details

Tomasz Miąsko

commit sha e1a54725081227a3866669c167bee4c0559f5362

Emit 1-based column numbers in debuginfo The debuginfo column numbers are 1-based. The value 0 indicates that no column has been specified. Translate 0-based column numbers to 1-based when emitting debug information.

view details

Tomasz Miąsko

commit sha 0c51f2f5a580a7e239accd0cc5f3da2e8cdf6f8c

Use byte offsets when emitting debuginfo columns

view details

Tomasz Miąsko

commit sha 8e93a01824a2239f1c588c7c0b884c8a2662e929

Test that column information is not emitted for MSVC targets

view details

Ryan Lopopolo

commit sha 2a29726fcd09fac350e0a8c0d1dd78a8ae6de0ed

Implement From<&mut str> for String

view details

12101111

commit sha 7ca1b2f504a77fd6d82c981242c577dae05f0b9e

Don't use static crt by default when build proc-macro.

view details

12101111

commit sha 7996df992fba0b7e09215843fcfabc0c53828c57

Run format.

view details

12101111

commit sha 89aebbdd7b6cea56284d53ab5aff5e62f1e67b67

Only run this test on musl

view details

12101111

commit sha 84349cc56492d70b37ec288f6f3e887858635fa4

Remove trailing whitespace.

view details

Andreas Molzer

commit sha 51b93966240acffdbe3fbb898bb647a03b146e09

Add unborrow to reset RefCell borrow state This method is complementary for the feature refcell_leak added in an earlier PR. It allows reverting the effects of leaking a borrow guard by statically proving that such a guard could not longer exist. This was not added to the existing `get_mut` out of concern of impacting the complexity of the otherwise pure pointer cast and because the name `get_mut` poorly communicates the intent of resetting remaining borrows.

view details

Yuki Okushi

commit sha d6a17b598f0e82535fc38c8455aed9571f44aaa2

Move tidy check to mingw-check

view details

Tomasz Miąsko

commit sha 726d5185e00d37ad7bd24aac4f05bf9fd34765be

bootstrap: Use hash to determine if sanitizers needs to be rebuilt * Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.

view details

Kornel

commit sha 8de1ec9ce0a53b8ad9987e923e833c82fda05603

Make error message clearer about creating new module

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

push time in 12 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 mod query; mod safe; mod serialized; -pub(crate) use self::dep_node::DepNodeParams;-pub use self::dep_node::{label_strs, DepConstructor, DepKind, DepNode, WorkProductId};-pub use self::graph::WorkProductFileKind;-pub use self::graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};-pub use self::prev::PreviousDepGraph;-pub use self::query::DepGraphQuery;-pub use self::safe::AssertDepGraphSafe;-pub use self::safe::DepGraphSafe;-pub use self::serialized::{SerializedDepGraph, SerializedDepNodeIndex};+pub use dep_node::{DepNode, DepNodeParams, WorkProductId};+pub use graph::WorkProductFileKind;+pub use graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};+pub use prev::PreviousDepGraph;+pub use query::DepGraphQuery;+pub use safe::AssertDepGraphSafe;+pub use safe::DepGraphSafe;+pub use serialized::{SerializedDepGraph, SerializedDepNodeIndex};++use rustc_data_structures::profiling::SelfProfilerRef;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use rustc_hir::def_id::DefId;++use std::fmt;+use std::hash::Hash;++pub trait DepContext: Copy {+    type DepKind: self::DepKind;+    type StableHashingContext: crate::HashStableContext;++    /// Create a hashing context for hashing new results.+    fn create_stable_hashing_context(&self) -> Self::StableHashingContext;++    /// Force the execution of a query given the associated `DepNode`.+    fn force_from_dep_node(&self, node: &DepNode<Self::DepKind>) -> bool;++    /// Extracts the DefId corresponding to this DepNode. This will work+    /// if two conditions are met:+    ///+    /// 1. The Fingerprint of the DepNode actually is a DefPathHash, and+    /// 2. the item that the DefPath refers to exists in the current tcx.+    ///+    /// Condition (1) is determined by the DepKind variant of the+    /// DepNode. Condition (2) might not be fulfilled if a DepNode+    /// refers to something from the previous compilation session that+    /// has been removed.+    fn extract_def_id(&self, node: &DepNode<Self::DepKind>) -> Option<DefId>;++    /// Check the legality of forcing this node.+    fn ensure_node_can_be_forced(&self, dep_dep_node: &DepNode<Self::DepKind>) -> Option<()>;++    /// Return whether the current session is tainted by errors.+    fn has_errors_or_delayed_span_bugs(&self) -> bool;++    /// Return the diagnostic handler.+    fn diagnostic(&self) -> &rustc_errors::Handler;++    /// Load data from the on-disk cache.+    fn try_load_from_on_disk_cache(&self, dep_node: &DepNode<Self::DepKind>);++    /// Load diagnostics associated to the node in the previous session.+    fn load_diagnostics(&self, prev_dep_node_index: SerializedDepNodeIndex) -> Vec<Diagnostic>;++    /// Register diagnostics for the given node, for use in next session.+    fn store_diagnostics(&self, dep_node_index: DepNodeIndex, diagnostics: ThinVec<Diagnostic>);++    /// Access the profiler.+    fn profiler(&self) -> &SelfProfilerRef;+}++/// Describe the different families of dependency nodes.+pub trait DepKind: Copy + fmt::Debug + Eq + Ord + Hash {+    /// Return whether this kind always require evaluation.+    fn is_eval_always(&self) -> bool;++    /// Return whether this kind requires additional parameters to be executed.+    fn has_params(&self) -> bool;++    /// Implementation of `std::fmt::Debug` for `DepNode`.+    fn debug_node(node: &DepNode<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result;++    /// Assert the current implicit context does not track any dependency.+    fn assert_ignored();

It seems like assert_ignored and with_ignore_deps can be implemented in terms of with_deps and read_deps.

cjgillot

comment created time in 12 days

Pull request review commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

 mod query; mod safe; mod serialized; -pub(crate) use self::dep_node::DepNodeParams;-pub use self::dep_node::{label_strs, DepConstructor, DepKind, DepNode, WorkProductId};-pub use self::graph::WorkProductFileKind;-pub use self::graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};-pub use self::prev::PreviousDepGraph;-pub use self::query::DepGraphQuery;-pub use self::safe::AssertDepGraphSafe;-pub use self::safe::DepGraphSafe;-pub use self::serialized::{SerializedDepGraph, SerializedDepNodeIndex};+pub use dep_node::{DepNode, DepNodeParams, WorkProductId};+pub use graph::WorkProductFileKind;+pub use graph::{hash_result, DepGraph, DepNodeColor, DepNodeIndex, TaskDeps, WorkProduct};+pub use prev::PreviousDepGraph;+pub use query::DepGraphQuery;+pub use safe::AssertDepGraphSafe;+pub use safe::DepGraphSafe;+pub use serialized::{SerializedDepGraph, SerializedDepNodeIndex};++use rustc_data_structures::profiling::SelfProfilerRef;+use rustc_data_structures::sync::Lock;+use rustc_data_structures::thin_vec::ThinVec;+use rustc_errors::Diagnostic;+use rustc_hir::def_id::DefId;++use std::fmt;+use std::hash::Hash;++pub trait DepContext: Copy {+    type DepKind: self::DepKind;+    type StableHashingContext: crate::HashStableContext;++    /// Create a hashing context for hashing new results.+    fn create_stable_hashing_context(&self) -> Self::StableHashingContext;++    /// Force the execution of a query given the associated `DepNode`.+    fn force_from_dep_node(&self, node: &DepNode<Self::DepKind>) -> bool;

You can merge force_from_dep_node with ensure_node_can_be_forced. You can name this try_force_previous_green which is what I used in https://github.com/rust-lang/rust/pull/62038.

cjgillot

comment created time in 12 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

Not sure about the Move TLS logic to librustc_query_system. and Parametrise the DepGraph using TyCtxt. commits. I'd like to start with the others first.

cjgillot

comment created time in 12 days

Pull request review commentrust-lang/rustc-dev-guide

Example of rustc interface

+#![feature(rustc_private)]++extern crate rustc;+extern crate rustc_error_codes;+extern crate rustc_errors;+extern crate rustc_hash;+extern crate rustc_hir;+extern crate rustc_interface;+extern crate rustc_span;++use rustc::session;+use rustc::session::config;+use rustc_errors::registry;+use rustc_hash::{FxHashMap, FxHashSet};+use rustc_interface::interface;+use rustc_span::source_map;+use std::path;+use std::process;+use std::str;++fn main() {+    let out = process::Command::new("rustc")+        .arg("--print=sysroot")+        .current_dir(".")+        .output()+        .unwrap();+    let sysroot = str::from_utf8(&out.stdout).unwrap().trim();+    let filename = "main.rs";+    let contents = "static HELLO: &str = \"Hello, world!\"; fn main() { println!(\"{}\", HELLO); }";+    let errors = registry::Registry::new(&rustc_error_codes::DIAGNOSTICS);+    let config = interface::Config {+        // Command line options+        opts: config::Options {+            maybe_sysroot: Some(path::PathBuf::from(sysroot)),+            ..config::Options::default()+        },++        // cfg! configuration in addition to the default ones+        // FxHashSet<(String, Option<String>)>+        crate_cfg: FxHashSet::default(),++        input: config::Input::Str {+            name: source_map::FileName::Custom(String::from(filename)),+            input: String::from(contents),+        },+        // Option<PathBuf>+        input_path: None,+        // Option<PathBuf>+        output_dir: None,+        // Option<PathBuf>

Not sure listing the types is very helpful.

georgewfraser

comment created time in 12 days

Pull request review commentrust-lang/rustc-dev-guide

Example of rustc interface

+#![feature(rustc_private)]++extern crate rustc;+extern crate rustc_error_codes;+extern crate rustc_errors;+extern crate rustc_hash;+extern crate rustc_hir;+extern crate rustc_interface;+extern crate rustc_span;++use rustc::session;+use rustc::session::config;+use rustc_errors::registry;+use rustc_hash::{FxHashMap, FxHashSet};+use rustc_interface::interface;+use rustc_span::source_map;+use std::path;+use std::process;+use std::str;++fn main() {+    let out = process::Command::new("rustc")+        .arg("--print=sysroot")+        .current_dir(".")+        .output()+        .unwrap();+    let sysroot = str::from_utf8(&out.stdout).unwrap().trim();+    let filename = "main.rs";+    let contents = "static HELLO: &str = \"Hello, world!\"; fn main() { println!(\"{}\", HELLO); }";+    let errors = registry::Registry::new(&rustc_error_codes::DIAGNOSTICS);+    let config = interface::Config {+        // Command line options+        opts: config::Options {+            maybe_sysroot: Some(path::PathBuf::from(sysroot)),+            ..config::Options::default()+        },++        // cfg! configuration in addition to the default ones+        // FxHashSet<(String, Option<String>)>+        crate_cfg: FxHashSet::default(),++        input: config::Input::Str {+            name: source_map::FileName::Custom(String::from(filename)),+            input: String::from(contents),+        },+        // Option<PathBuf>+        input_path: None,+        // Option<PathBuf>+        output_dir: None,+        // Option<PathBuf>+        output_file: None,+        // Option<Box<dyn FileLoader + Send + Sync>>+        file_loader: None,+        diagnostic_output: session::DiagnosticOutput::Default,++        // Set to capture stderr output during compiler execution+        // Option<Arc<Mutex<Vec<u8>>>>+        stderr: None,++        // Option<String>+        crate_name: None,+        // FxHashMap<lint::LintId, lint::Level>+        lint_caps: FxHashMap::default(),++        // This is a callback from the driver that is called when we're registering lints;+        // it is called during plugin registration when we have the LintStore in a non-shared state.+        //+        // Note that if you find a Some here you probably want to call that function in the new+        // function being registered.+        // Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>+        register_lints: None,++        // This is a callback from the driver that is called just after we have populated+        // the list of queries.+        //+        // The second parameter is local providers and the third parameter is external providers.+        // Option<fn(&Session, &mut ty::query::Providers<'_>, &mut ty::query::Providers<'_>)>+        override_queries: None,++        // Registry of diagnostics codes.+        registry: errors,+    };+    interface::run_compiler(config, |compiler| {+        compiler.enter(|queries| {+            // Parse the program and print the syntax tree.+            let parse = queries.parse().unwrap().take();+            println!("{:#?}", parse);+            // Analyze the program and inspect the types of definitions.+            queries.global_ctxt().unwrap().take().enter(|ctx| {

ctx should be named tcx here to match the compiler convention.

georgewfraser

comment created time in 12 days

pull request commentrust-lang/rust

Don't unwind when hitting the macro expansion recursion limit

Looks like the PR build also failed in https://github.com/rust-lang/rust/pull/70110, which doesn't happen here. I'm going to assume some other PR was the cause of the failure.

@bors r=petrochenkov

Zoxc

comment created time in 12 days

pull request commentrust-lang/rust

[WIP] Remove `StorageDead` and `StorageLive` statements using MIR locals of type `()`

I think the test failure happens because Miri does not mark the locals as deallocated on return like it should. I also noticed that it doesn't initialize locals as dead if Storage* statements are used and the Mir is in a constant, but clearly those still affect constants.

It seems like the semantics for Mir used for constant contexts diverge from Mir intended to execute that run-time. I'm not sure how intentional this is, but it doesn't seem great.

Zoxc

comment created time in 13 days

pull request commentrust-lang/rust

Make the `type_of` return a generic type for generators

@bors r=nikomatsakis

Zoxc

comment created time in 14 days

PullRequestEvent

pull request commentrust-lang/rust

Make the `type_of` return a generic type for generators

It appears the output from 64-bit builds now matches 32-bit builds. Not sure if that's due to https://github.com/rust-lang/rust/pull/69189. I expected that to erase regions.

Zoxc

comment created time in 14 days

pull request commentrust-lang/rust

Move the dep_graph construction to a dedicated crate.

You have to push the commit that was on the branch when it was closed in order for PRs to reopen. It's a stupid Github limitation.

cjgillot

comment created time in 14 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 13344e507c65978c3d76f27eca1b7a2d910f06dd

Update tests

view details

push time in 14 days

pull request commentrust-lang/rust

Make the `type_of` return a generic type for generators

It doesn't seem like https://github.com/rust-lang/rust/pull/69189 helps.

Zoxc

comment created time in 14 days

pull request commentrust-lang/rust

hir: replace "items" terminology with "nodes" where appropriate.

@bors r+

eddyb

comment created time in 14 days

push eventZoxc/rust

LeSeulArtichaut

commit sha 842448d3102f236401d6a2d176e39977efe91176

Add newline between summary and stable version documentation

view details

LeSeulArtichaut

commit sha 768470b901eb9b8a06ccc56d3f85d18dd7ac6b69

Fix mistake in atomic comparaison docs

view details

LeSeulArtichaut

commit sha d53ee472eb96da448ffd6392678ff3eeb1e87a37

Remove references to `wrapping` methods

view details

LeSeulArtichaut

commit sha b22d3703a873adb097b89ea9285d4d7a97ecd67d

Document stabilized versions of atomic singlethreaded fences

view details

Linus Färnstrand

commit sha 271ba5a3ea59f25ebc7ba3b9a2e620a833e50b33

Stabilize assoc_int_consts

view details

Linus Färnstrand

commit sha 35298349c3efd75cd8050f9f23e4bf1409d96118

Add "soft deprecation" notice to old min/max_value() docs

view details

Linus Färnstrand

commit sha 97bdd31b0eab51d0a51b8746123f910cd868dff3

Add "soft deprecation" notice to old MIN/MAX docs

view details

Linus Färnstrand

commit sha fd71fbe8d51dc291f87fdb6beb12e174a304bd0c

Remove reference from integer docs to their modules

view details

Linus Färnstrand

commit sha cf255c6dc1a9c41bf8e98865d85f8577ce8d2056

Use new preferred consts in int docs

view details

Linus Färnstrand

commit sha 5e17f31d94a0e2f1e69d5c4bd5171cf48ff9e5b0

Replace min/max_value() with MIN/MAX in integer docs

view details

Linus Färnstrand

commit sha 847a0dd845dbc74b4d49adf873c585519e356b4e

Remove uint_macros that was identical to int_macros

view details

Linus Färnstrand

commit sha c67de2570f881a0601f15c7c15e1fb9a26f2d3bf

Add notice about using new consts in new code on float modules

view details

Linus Färnstrand

commit sha 086927480be716a14f9c68954d417b544066184b

Add notice about using new consts in new code on int modules

view details

Linus Färnstrand

commit sha 83191c2da6da6c13466f7f30568cdea02c761ca0

Update float documentation to use associated consts

view details

Linus Färnstrand

commit sha b2dc6187699d99436f6183218d928be09d439578

Add usage recommendation to old float constants

view details

spunit262

commit sha 30d4f1b78d997fb555388cb8ebea474ffb85794c

Don't give invalid suggestion on desugared span.

view details

Markus Westerlind

commit sha 851a701f90081fbc83fa151e9f272cea2a990779

Reuse a Vec in mir simplification

view details

Markus Westerlind

commit sha dec8166abc6675627819723b10301e395f3876d5

Use Vec::append

view details

Markus Westerlind

commit sha 33513fad8089956adcbb5b9803f56de1a8e94b57

Avoid an intermediate Vec in mir simplify

view details

Markus Westerlind

commit sha 2440998666cb9fe5f35c1de9ef44849b71870fc3

perf(mir): Reserve enough space for the merged blocks before appending

view details

push time in 14 days

Pull request review commentrust-lang/rust

hir: replace "items" terminology with "nodes" where appropriate.

 rustc_queries! {         }          // The items in a module.+        //         // This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`.         // Avoid calling this query directly.         query hir_module_items(key: LocalDefId) -> &'tcx hir::ModuleItems {             eval_always             desc { |tcx| "HIR module items in `{}`", tcx.def_path_str(key.to_def_id()) }         } -        // An HIR item with a `LocalDefId` that can own other HIR items which do-        // not themselves have a `LocalDefId`.+        // An HIR node with a `LocalDefId` and which can also own other (non-owner) HIR nodes.+        //         // This can be conveniently accessed by methods on `tcx.hir()`.         // Avoid calling this query directly.-        query hir_owner(key: LocalDefId) -> &'tcx HirOwner<'tcx> {+        query hir_owner(key: LocalDefId) -> &'tcx crate::hir::Owner<'tcx> {             eval_always             desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) }         } -        // The HIR items which do not themselves have a `LocalDefId` and are-        // owned by another HIR item with a `LocalDefId`.+        // The (non-owner) HIR nodes owned by the owner HIR node with a given `LocalDefId`.

And this as:

Gives access to the HIR nodes and bodies inside the HIR owner `key`.
eddyb

comment created time in 14 days

Pull request review commentrust-lang/rust

hir: replace "items" terminology with "nodes" where appropriate.

 rustc_queries! {         }          // The items in a module.+        //         // This can be conveniently accessed by `tcx.hir().visit_item_likes_in_module`.         // Avoid calling this query directly.         query hir_module_items(key: LocalDefId) -> &'tcx hir::ModuleItems {             eval_always             desc { |tcx| "HIR module items in `{}`", tcx.def_path_str(key.to_def_id()) }         } -        // An HIR item with a `LocalDefId` that can own other HIR items which do-        // not themselves have a `LocalDefId`.+        // An HIR node with a `LocalDefId` and which can also own other (non-owner) HIR nodes.

Maybe phrase this as:

Gives access to the HIR node for the HIR owner `key`.
eddyb

comment created time in 14 days

pull request commentrust-lang/rust

hir: replace "items" terminology with "nodes" where appropriate.

The PR looks good to me excluding the comments on the queries.

eddyb

comment created time in 14 days

Pull request review commentrust-lang/rust

hir: replace "items" terminology with "nodes" where appropriate.

 rustc_queries! {             eval_always         } -        // An HIR item with a `DefId` that can own other HIR items which do not themselves have+        // An HIR node with a `DefId` that can own other HIR nodes which do not themselves have

I think it's probably better to assume that the reader know what a HIR owner is here. I can barely make sense of the comments and I wrote the code =P

eddyb

comment created time in 14 days

push eventZoxc/rust

Tim Vermeulen

commit sha 14bcf0aaa51138afdd95190d814f4b46013f990e

Fix Peekable::next_back

view details

Tim Vermeulen

commit sha 16a23e72d05b0e3cb48f0a5442e651725bf27ae8

Fuse FlattenCompat's inner iterator

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

Nicholas Nethercote

commit sha 54d1c50c7e7b4c4c7dca6c85c6965c886922b449

Remove `sip::Hasher::short_write`. `sip::Hasher::short_write` is currently unused. It is called by `sip::Hasher::write_{u8,usize}`, but those methods are also unused, because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement any of the `write_xyz` methods, so all their write operations end up calling `sip::Hasher::write`. (I confirmed this by inserting a `panic!` in `sip::Hasher::short_write` and running the tests -- they all passed.) The alternative would be to add all the missing `write_xyz` methods. This does give some significant speed-ups, but it hurts compile times a little in some cases. See #69152 for details. This commit does the conservative thing and doesn't change existing behaviour.

view details

Tomasz Miąsko

commit sha e1a54725081227a3866669c167bee4c0559f5362

Emit 1-based column numbers in debuginfo The debuginfo column numbers are 1-based. The value 0 indicates that no column has been specified. Translate 0-based column numbers to 1-based when emitting debug information.

view details

Tomasz Miąsko

commit sha 0c51f2f5a580a7e239accd0cc5f3da2e8cdf6f8c

Use byte offsets when emitting debuginfo columns

view details

Tomasz Miąsko

commit sha 8e93a01824a2239f1c588c7c0b884c8a2662e929

Test that column information is not emitted for MSVC targets

view details

Ryan Lopopolo

commit sha 2a29726fcd09fac350e0a8c0d1dd78a8ae6de0ed

Implement From<&mut str> for String

view details

12101111

commit sha 7ca1b2f504a77fd6d82c981242c577dae05f0b9e

Don't use static crt by default when build proc-macro.

view details

12101111

commit sha 7996df992fba0b7e09215843fcfabc0c53828c57

Run format.

view details

12101111

commit sha 89aebbdd7b6cea56284d53ab5aff5e62f1e67b67

Only run this test on musl

view details

12101111

commit sha 84349cc56492d70b37ec288f6f3e887858635fa4

Remove trailing whitespace.

view details

Andreas Molzer

commit sha 51b93966240acffdbe3fbb898bb647a03b146e09

Add unborrow to reset RefCell borrow state This method is complementary for the feature refcell_leak added in an earlier PR. It allows reverting the effects of leaking a borrow guard by statically proving that such a guard could not longer exist. This was not added to the existing `get_mut` out of concern of impacting the complexity of the otherwise pure pointer cast and because the name `get_mut` poorly communicates the intent of resetting remaining borrows.

view details

Yuki Okushi

commit sha d6a17b598f0e82535fc38c8455aed9571f44aaa2

Move tidy check to mingw-check

view details

Tomasz Miąsko

commit sha 726d5185e00d37ad7bd24aac4f05bf9fd34765be

bootstrap: Use hash to determine if sanitizers needs to be rebuilt * Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.

view details

Kornel

commit sha 8de1ec9ce0a53b8ad9987e923e833c82fda05603

Make error message clearer about creating new module

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

push time in 14 days

push eventZoxc/rust

Tim Vermeulen

commit sha 14bcf0aaa51138afdd95190d814f4b46013f990e

Fix Peekable::next_back

view details

Tim Vermeulen

commit sha 16a23e72d05b0e3cb48f0a5442e651725bf27ae8

Fuse FlattenCompat's inner iterator

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

12101111

commit sha 7ca1b2f504a77fd6d82c981242c577dae05f0b9e

Don't use static crt by default when build proc-macro.

view details

12101111

commit sha 7996df992fba0b7e09215843fcfabc0c53828c57

Run format.

view details

12101111

commit sha 89aebbdd7b6cea56284d53ab5aff5e62f1e67b67

Only run this test on musl

view details

12101111

commit sha 84349cc56492d70b37ec288f6f3e887858635fa4

Remove trailing whitespace.

view details

Yuki Okushi

commit sha d6a17b598f0e82535fc38c8455aed9571f44aaa2

Move tidy check to mingw-check

view details

Tomasz Miąsko

commit sha 726d5185e00d37ad7bd24aac4f05bf9fd34765be

bootstrap: Use hash to determine if sanitizers needs to be rebuilt * Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.

view details

Kornel

commit sha 8de1ec9ce0a53b8ad9987e923e833c82fda05603

Make error message clearer about creating new module

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

Jonas Schievink

commit sha 2cbccced0856260c6acafabecb3030465dff28c2

Add test for unnecessary panic branches

view details

12101111

commit sha dbed65afaede1a819c5a7319685721339b61733b

Simplify checking of crt_static_feature()

view details

Guillaume Gomez

commit sha 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256

clean up E0308 explanation

view details

Guillaume Gomez

commit sha 64460a12af8786a1859279d2944fd2fc67a3a159

Update tests

view details

Jonas Schievink

commit sha cb58de81654d92074a4abdbf90400f35f6a0062f

Apply suggestions from code review Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>

view details

12101111

commit sha 7a89bf166719d46b85c2d00686380587e46ec10d

override flags from compiletest

view details

push time in 14 days

push eventZoxc/rust

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

Jonas Schievink

commit sha 2cbccced0856260c6acafabecb3030465dff28c2

Add test for unnecessary panic branches

view details

Guillaume Gomez

commit sha 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256

clean up E0308 explanation

view details

Guillaume Gomez

commit sha 64460a12af8786a1859279d2944fd2fc67a3a159

Update tests

view details

Jonas Schievink

commit sha cb58de81654d92074a4abdbf90400f35f6a0062f

Apply suggestions from code review Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>

view details

Josh Stone

commit sha 543832b06c7fccd570a85e2f30a447303fd58602

Regenerate tables for Unicode 13.0.0

view details

Ralf Jung

commit sha f5efb68a24b66a21b7eca055b9e8867eeaf61366

miri: categorize errors into "unsupported" and "UB" Also slightly refactor pointer bounds checks to avoid creating unnecessary temporary Errors

view details

Ralf Jung

commit sha d02543a453f0381c92339301fc86bcc08c70abcd

fmt, tweak messages and bless

view details

Ralf Jung

commit sha 9a95b010e6b46d113228b67ef237b42868e7be8d

generalize InvalidNullPointerUsage to InvalidIntPointerUsage

view details

Ralf Jung

commit sha 3ebcd78b4285cee14f6b479d33bc939a5cc0414b

fmt, and fix rustfmt-induced rebase hickup

view details

Ralf Jung

commit sha 2764d3d3e42d86bd089863822b7469cc1669ef8e

start Miri messages lower-case

view details

Ralf Jung

commit sha 3e6144290535e17a2366a1b11cebc2222fa300cb

explain why we catch PointerUseAfterFree

view details

Ralf Jung

commit sha d8f81680a1232638df81e684b60ac60f3e0318f7

avoid boolean inversion

view details

Ralf Jung

commit sha 968142294385228fdc8af954dcd5be013404fba5

we are on 2018 edition, use try block

view details

Ralf Jung

commit sha 93436d8fd76d04f0d25ade71eec2ed480af3f404

make error message less confusing

view details

Ralf Jung

commit sha e219dd4a2df1d9d3e082c0a6154dd20be21865e7

fmt

view details

push time in 14 days

push eventZoxc/rust

Tim Vermeulen

commit sha 14bcf0aaa51138afdd95190d814f4b46013f990e

Fix Peekable::next_back

view details

Tim Vermeulen

commit sha 16a23e72d05b0e3cb48f0a5442e651725bf27ae8

Fuse FlattenCompat's inner iterator

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

12101111

commit sha 7ca1b2f504a77fd6d82c981242c577dae05f0b9e

Don't use static crt by default when build proc-macro.

view details

12101111

commit sha 7996df992fba0b7e09215843fcfabc0c53828c57

Run format.

view details

12101111

commit sha 89aebbdd7b6cea56284d53ab5aff5e62f1e67b67

Only run this test on musl

view details

12101111

commit sha 84349cc56492d70b37ec288f6f3e887858635fa4

Remove trailing whitespace.

view details

Yuki Okushi

commit sha d6a17b598f0e82535fc38c8455aed9571f44aaa2

Move tidy check to mingw-check

view details

Tomasz Miąsko

commit sha 726d5185e00d37ad7bd24aac4f05bf9fd34765be

bootstrap: Use hash to determine if sanitizers needs to be rebuilt * Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

Jonas Schievink

commit sha 2cbccced0856260c6acafabecb3030465dff28c2

Add test for unnecessary panic branches

view details

12101111

commit sha dbed65afaede1a819c5a7319685721339b61733b

Simplify checking of crt_static_feature()

view details

Guillaume Gomez

commit sha 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256

clean up E0308 explanation

view details

Guillaume Gomez

commit sha 64460a12af8786a1859279d2944fd2fc67a3a159

Update tests

view details

Jonas Schievink

commit sha cb58de81654d92074a4abdbf90400f35f6a0062f

Apply suggestions from code review Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>

view details

12101111

commit sha 7a89bf166719d46b85c2d00686380587e46ec10d

override flags from compiletest

view details

12101111

commit sha 75e6cfc79b39253ee0e4fafc7805c7b0a1f24ef2

run crt-static test on all target

view details

push time in 14 days

pull request commentrust-lang/rust

[WIP] Add queries for LocalDefId <-> HirId conversion

@bors try

Zoxc

comment created time in 14 days

push eventZoxc/rust

Tim Vermeulen

commit sha 14bcf0aaa51138afdd95190d814f4b46013f990e

Fix Peekable::next_back

view details

Tim Vermeulen

commit sha 16a23e72d05b0e3cb48f0a5442e651725bf27ae8

Fuse FlattenCompat's inner iterator

view details

Giles Cope

commit sha a113609bdf0f05a3f32ab2f19bed38bde0d7063a

keyword docs for else and inkeyword docs for else and in.

view details

12101111

commit sha 7ca1b2f504a77fd6d82c981242c577dae05f0b9e

Don't use static crt by default when build proc-macro.

view details

12101111

commit sha 7996df992fba0b7e09215843fcfabc0c53828c57

Run format.

view details

12101111

commit sha 89aebbdd7b6cea56284d53ab5aff5e62f1e67b67

Only run this test on musl

view details

12101111

commit sha 84349cc56492d70b37ec288f6f3e887858635fa4

Remove trailing whitespace.

view details

Yuki Okushi

commit sha d6a17b598f0e82535fc38c8455aed9571f44aaa2

Move tidy check to mingw-check

view details

Tomasz Miąsko

commit sha 726d5185e00d37ad7bd24aac4f05bf9fd34765be

bootstrap: Use hash to determine if sanitizers needs to be rebuilt * Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.

view details

Jonas Schievink

commit sha 425e7e5596c0ab6555fa75292d38863280d4a3d7

Don't insert panic when generator can not return

view details

Jonas Schievink

commit sha 5ac41a1a8d28493c7aa927ae49c664b9b9dce476

Don't insert panic when generator can not unwind

view details

Jonas Schievink

commit sha 46aeef6e655a85087f82bb0d1f94a97e83009218

Poison generators when any terminator unwinds This didn't cause issues before since generator types were always considered to "need drop", leading to unwind paths (including a `Resume` block) always getting generated.

view details

Jonas Schievink

commit sha 8d9f633f4d78777487010ae119454dc9674e42ee

Change index for SwitchInt case The indices do not matter here, and this fixes an index out of bounds panic when compiling a generator that can unwind but not return.

view details

Jonas Schievink

commit sha 2cbccced0856260c6acafabecb3030465dff28c2

Add test for unnecessary panic branches

view details

12101111

commit sha dbed65afaede1a819c5a7319685721339b61733b

Simplify checking of crt_static_feature()

view details

Guillaume Gomez

commit sha 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256

clean up E0308 explanation

view details

Guillaume Gomez

commit sha 64460a12af8786a1859279d2944fd2fc67a3a159

Update tests

view details

Jonas Schievink

commit sha cb58de81654d92074a4abdbf90400f35f6a0062f

Apply suggestions from code review Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>

view details

12101111

commit sha 7a89bf166719d46b85c2d00686380587e46ec10d

override flags from compiletest

view details

12101111

commit sha 75e6cfc79b39253ee0e4fafc7805c7b0a1f24ef2

run crt-static test on all target

view details

push time in 14 days

more