Rust library for build scripts to compile C/C++ code into a Rust library
a safe, concurrent, practical language
The Rust package manager
A project for generating C bindings from Rust code
ccache – a fast compiler cache
Rust build dependency for running cmake
petrochenkov/compiler-builtins 0
Porting `compiler-rt` intrinsics to Rust
a diff that understands syntax 🟥🟩
petrochenkov/displaydoc-lite 0
Implement the Display trait using your normal doc comments.
pull request commentrust-lang/rust
feat: add `expansion_growth_limit` attr as another expansion limit
Although from the first crater run results it's already clear that the PR isn't going to work as written, one of the regressions, for example, hits the output size limit simply by generating a large PHF table.
comment created time in 17 hours
pull request commentrust-lang/rust
feat: add `expansion_growth_limit` attr as another expansion limit
@craterbot check p=1 crates=https://crater-reports.s3.amazonaws.com/pr-103029/retry-regressed-list.txt
comment created time in 17 hours
pull request commentrust-lang/rust
feat: add `expansion_growth_limit` attr as another expansion limit
the tests results look flaky
That's a pretty usual result, it's unlikely that you'll get something different on a second run. We can rerun crater on the regressed results only though. @craterbot abort
comment created time in 17 hours
pull request commentrust-lang/rust
resolve: Remove artificial import ambiguity errors
@est31 I think this specific case will error with
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=6492f42d9a13a034d74a720e219b516d (It's a part of the "time travel" prevention.)
comment created time in 2 days
pull request commentrust-lang/rust
I don't think this is an improvement, the rfcs
directory is artificial, meaningless by itself, and doesn't map to a WG or a set of people that work on a specific compiler area and could maintain the corresponding subset of tests.
I think specific rfc-NNNN-feature-name
subdirectories should be moved to "semantically meaningful" subdirectories like privacy
, or lexer
, or auto-traits
or whatever.
cc https://github.com/rust-lang/rust/issues/73494
comment created time in 2 days
pull request commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
This is very close to being ready, I only had some style comments. @rustbot author
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
//! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`. +use rustc_span::{def_id::DefId, symbol::Ident, Span};++use crate::MetaItem;+ pub mod allocator;++#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)]+pub struct StrippedCfgItem<ModId = DefId> {
You are right, current_expansion.lint_node_id
is just freshly assigned when append_stripped_out_item
is called, let's keep it as is.
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
impl<'a, 'b> InvocationCollector<'a, 'b> { return match self.take_first_attr(&mut node) { Some((attr, pos, derives)) => match attr.name_or_empty() { sym::cfg => {- if self.expand_cfg_true(&mut node, attr, pos) {+ let (res, meta_item) = self.expand_cfg_true(&mut node, attr, pos);+ if res { continue; }++ if let Some(meta_item) = meta_item {+ let parent_module = self.cx.current_expansion.lint_node_id;++ for name in node.declared_names() {+ self.cx.resolver.append_stripped_out_item(+ parent_module,
self.cx.current_expansion.lint_node_id,
(Not necessarily a module too.)
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized { fn expand_cfg_false(&mut self, collector: &mut InvocationCollector<'_, '_>, span: Span) { collector.cx.emit_err(RemoveNodeNotSupported { span, descr: Self::descr() }); }+ fn declared_names(&self) -> Vec<Ident> {
This needs a comment saying that it's for diagnostics only, it's an approximation that cannot be used for anything precise.
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> { self.proc_macros.push(id) } + fn append_stripped_out_item(&mut self, parent_module: NodeId, name: Ident, cfg: ast::MetaItem) {
fn append_stripped_cfg_item(&mut self, parent_module: NodeId, name: Ident, cfg: ast::MetaItem) {
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
use crate::Namespace::*; use crate::{BuiltinMacroState, Determinacy}; use crate::{DeriveData, Finalize, ParentScope, ResolutionError, Resolver, ScopeSet}; use crate::{ModuleKind, ModuleOrUniformRoot, NameBinding, PathResult, Segment};+use ast::expand::StrippedCfgItem;
use rustc_ast::expand::StrippedCfgItem;
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
pub trait ResolverExpand { /// HIR proc macros items back to their harness items. fn declare_proc_macro(&mut self, id: NodeId); + fn append_stripped_out_item(&mut self, parent_module: NodeId, name: Ident, cfg: ast::MetaItem);
fn append_stripped_out_item(&mut self, parent_node: NodeId, name: Ident, cfg: ast::MetaItem);
As implemented (self.cx.current_expansion.lint_node_id
) it's not necessarily a module.
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
pub struct Resolver<'a, 'tcx> { /// Whether lifetime elision was successful. lifetime_elision_allowed: FxHashSet<NodeId>, + /// Names of items that were stripped out via cfg with their corresponding cfg meta item.+ stripped_out_items: Vec<ast::expand::StrippedCfgItem<NodeId>>,
stripped_out_items: Vec<StrippedCfgItem<NodeId>>,
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
pub struct Resolver<'a, 'tcx> { /// Whether lifetime elision was successful. lifetime_elision_allowed: FxHashSet<NodeId>, + /// Names of items that were stripped out via cfg with their corresponding cfg meta item.+ stripped_out_items: Vec<ast::expand::StrippedCfgItem<NodeId>>,
stripped_cfg_items: Vec<ast::expand::StrippedCfgItem<NodeId>>,
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
impl<'a, 'tcx> Resolver<'a, 'tcx> { let main_def = self.main_def; let confused_type_with_std_module = self.confused_type_with_std_module; let effective_visibilities = self.effective_visibilities;++ self.tcx.feed_local_crate().stripped_cfg_items(self.tcx.arena.alloc_from_iter(+ self.stripped_out_items.into_iter().filter_map(|item| {+ let parent_module = self.node_id_to_def_id.get(&item.parent_module)?.to_def_id();+ Some(ast::expand::StrippedCfgItem { parent_module, name: item.name, cfg: item.cfg })
Some(StrippedCfgItem { parent_module, name: item.name, cfg: item.cfg })
comment created time in 5 days
Pull request review commentrust-lang/rust
Remember names of `cfg`-ed out items to mention them in diagnostics
impl<'a, 'tcx> AsMut<Resolver<'a, 'tcx>> for Resolver<'a, 'tcx> { } impl<'tcx> Resolver<'_, 'tcx> {- fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {+ pub fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {
fn opt_local_def_id(&self, node: NodeId) -> Option<LocalDefId> {
comment created time in 5 days
pull request commentrust-lang/rust
Force all native libraries to be statically linked when linking a static binary
Too bad there's no Windows-based infra for crater.
The job dist-i686-msvc failed! Check out the build log: (web) (plain)
Well, looks like we didn't even need crater. @rustbot author
comment created time in 5 days
pull request commentrust-lang/rust
Force all native libraries to be statically linked when linking a static binary
@bors rollup=never r=me after answering https://github.com/rust-lang/rust/pull/111698#issuecomment-1572105083.
comment created time in 5 days
Pull request review commentrust-lang/rust
Force all native libraries to be statically linked when linking a static binary
fn add_native_libs_from_crate( } } NativeLibKind::Unspecified => {- if link_dynamic {- cmd.link_dylib(name, verbatim, true);+ if prefer_link_static {
if !link_output_kind.can_link_dylib() {
Nit: it's only used once now.
comment created time in 5 days
pull request commentrust-lang/rust
Force all native libraries to be statically linked when linking a static binary
@Amanieu Did you check the regressions? Is there anything non-spurious there?
comment created time in 5 days
pull request commentrust-lang/rust
Turn `INVALID_DOC_ATTRIBUTES` lint into a hard error
@craterbot check
Enqueuing this PR for crater again, to run after beta-170-4. @Mark-Simulacrum or do you mean other experiments cannot run together with beta at all? Due to improved crater parallelism or something.
comment created time in 5 days
pull request commentrust-lang/rust
Ignore parent locals when resolving in local items
First of all, I'm not sure this is something that needs to be fixed. I'll refresh https://github.com/rust-lang/rust/issues/33118 in memory and see how it fits into the current name resolution story.
comment created time in 6 days
pull request commentrust-lang/rust
Populate effective visibilities in `rustc_privacy` (take 2)
@craterbot abort name=pr-111425
comment created time in 6 days
pull request commentrust-lang/rust
Populate effective visibilities in `rustc_privacy` (take 2)
@craterbot abort
Crate failed with "Report failed", but the PR was never removed from the crater dashboard.
comment created time in 6 days
pull request commentrust-lang/rust
Turn `INVALID_DOC_ATTRIBUTES` lint into a hard error
@craterbot check
comment created time in 6 days
pull request commentrust-lang/rust
Turn `INVALID_DOC_ATTRIBUTES` lint into a hard error
I don't see any recent crater runs on this. @bors try
comment created time in 6 days