profile
viewpoint
Vadim Petrochenkov petrochenkov Moscow, Russia

petrochenkov/cargo 0

The Rust package manager

petrochenkov/ccache 0

ccache – a fast compiler cache

petrochenkov/cmake-rs 0

Rust build dependency for running cmake

petrochenkov/dynamorio 0

Dynamic Instrumentation Tool Platform

petrochenkov/highfive 0

Github hooks to provide an encouraging atmosphere for new contributors

petrochenkov/reference 0

The Rust Reference

petrochenkov/rfcs 0

RFCs for changes to Rust

petrochenkov/rls 0

Repository for the Rust Language Server (aka RLS)

petrochenkov/rust 0

a safe, concurrent, practical language

push eventpetrochenkov/rust

Vadim Petrochenkov

commit sha e93a29ddde6e5074b55f0e142a796fc01e360d98

Add some comments for magic numbers

view details

push time in 2 hours

pull request commentrust-lang/rust

rustc_ast: Stop using "string typing" for doc comment tokens

Updated with the requested comments.

petrochenkov

comment created time in 2 hours

push eventpetrochenkov/rust

flip1995

commit sha f7acea2683c6124854bfe20e7127e4dfba344d3e

Register redundant_field_names and non_expressive_names as early passes

view details

flip1995

commit sha 485229c4a3d6a2fbe40f5a6976a33144a27497c6

Fix fallout in redundant_field_names

view details

flip1995

commit sha efd3dcff97f67f376e354c047133ce9044c52991

Fix fallout in similar_names

view details

Eduardo Broto

commit sha bb37a0f948b02e6434dbe3ea615960052d37f784

Avoid triggering similar names on code from expansion

view details

Alexis Bourget

commit sha 2853448426ce76926baa7e6e6173c15228e4951a

Document the ref keyword

view details

Stefan Lankes

commit sha 6813c1c69baf870a479c70e23ad0550d1d9aa9be

revise RwLock, which is derived from the wasm implementation - increasing the readability of `Condvar` - simplify the interface to the libos HermitCore

view details

Stefan Lankes

commit sha 3acc3ef10d2099a4b3118e8c705b36f4bbaf6f64

minor changes to pass the format check

view details

Stefan Lankes

commit sha beb1b1fa5b1047c7caf8a1d499725df3c1ad8cad

reorder crates to pass the format check

view details

Stefan Lankes

commit sha f9c609164251abc136eb9bda55c92cb99adb5c86

remove some compiler warnings

view details

Trevor Spiteri

commit sha 6dfe144bdd4413ac55cbb2ad2edfb1daa0c4bf15

stabilize const_nonzero_int_methods

view details

Trevor Spiteri

commit sha 9739b512a892628534e730ffcd9756b3218c8de8

stabilize some const_checked_int_methods

view details

Trevor Spiteri

commit sha c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799

stabilize const_saturating_int_methods

view details

Trevor Spiteri

commit sha 056d925167318636fcf975c8ffb81efebdc9bca3

stabilize const_int_sign

view details

Trevor Spiteri

commit sha 2a84e313df095fd0e81b9348b68bd9b1d1caa551

stabilize const_ascii_ctype_on_intrinsics

view details

Adam Perry

commit sha d275739c09f266479d6db388cbf55ba6ca791b9d

Derive common traits for panic::Location. Add documentation about the host/target behavior of Location::file.

view details

Jamie Cunliffe

commit sha fc52b47e8013da325fc0a0f5d3897143243ba206

va_args implementation for AAPCS. Implement the va args in codegen for AAPCS, this will be used as the default va_args implementation for AArch64 rather than the va_args llvm-ir as it currently is. Copyright (c) 2020, Arm Limited.

view details

Alexis Bourget

commit sha 837a761b398a6ff6a97f7f61e390dae9efbeab79

Document the where keyword

view details

Andrey Zgarbul

commit sha 7d4a92d4f8dc03409984695d78893fffdd3ff1f9

remove LengthAtMost32 on AsRef/Borrow impl for array

view details

Roman Proskuryakov

commit sha eff62069ad602090e8d27b83cffd9e77479ed4be

Remove the usage of the LengthAtMost32 trait

view details

Roman Proskuryakov

commit sha 4ad40a8737ab4ffaf6352ec4560fd86cb0b4ade8

Remove LengthAtMost32

view details

push time in 2 hours

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

https://github.com/rust-lang/rust/pull/75043 has landed.

nnethercote

comment created time in 3 hours

pull request commentrust-lang/rust

Inlined symbols

Zulip discussion from the previous meeting - https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.20meeting.5D.202020-07-30.20.2354818/near/205485071. Looks like there's some support for landing this.

nnethercote

comment created time in 3 hours

pull request commentrust-lang/rust

Clean up errors caused by `::` -> `:` typos

The pre-requisite PRs have landed.

estebank

comment created time in 3 hours

pull request commentrust-lang/rust

Don't serialize ExpnData for foreign crates

r? @petrochenkov

Aaron1011

comment created time in 14 hours

pull request commentrust-lang/rust

Hash parent ExpnData

r? @petrochenkov

Aaron1011

comment created time in 14 hours

pull request commentrust-lang/rust

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

@bors r=nnethercote

petrochenkov

comment created time in a day

Pull request review commentrust-lang/rust

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

 impl Attribute {         }     } -    /// Returns `true` if the attribute's path matches the argument. If it matches, then the-    /// attribute is marked as used.+    /// Returns `true` if the attribute's path matches the argument.+    /// If it matches, then the attribute is marked as used.+    /// Should only be used by rustc, other tools can use `has_name` instead.

Done.

petrochenkov

comment created time in a day

push eventpetrochenkov/rust

Pietro Albini

commit sha cb76f821942053091706b7bb2c4dc416bb09bfb9

ci: avoid symlinking the build directory on self-hosted builders

view details

Pietro Albini

commit sha fe5a40eb14f233554a30c038cf8944b2d2adf9ff

ci: add aarch64-gnu as a fallible auto builder

view details

Stein Somers

commit sha c4f4639e1a2eb07d17e7393a1c7f0594f0c11faf

Remove into_slices and its unsafe block

view details

Paul Sajna

commit sha 7baa87fccf2d9788530e6efc762d326d47d68617

bump libc version to 0.2.74

view details

Yuki Okushi

commit sha 8b778a5f8d244a402355cc532107372beec4afc8

Revert "Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern" This reverts commit f5e5eb6f46ef2cf0dd45dba4f975305509334fc6.

view details

Yuki Okushi

commit sha c2afce4058e65a23d115b90078427afb17702e44

Fix ICEs with `@ ..` binding

view details

Lzu Tao

commit sha 07575286b81da73d88c29e4581fdcc9dec3508ed

Remove as_deref_err and as_deref_mut_err from Result

view details

Lzu Tao

commit sha c25f25f7f18728eef288c45f77477232b9c5d203

Stabilize as_deref and as_deref on Result

view details

Lzu Tao

commit sha 6d293ede9f0790e1a450113bfbda0998fec9e48c

Update tests

view details

Shen-Ta Hsieh

commit sha 4c851792ac28c6fb09828a036b7fe3d4e1707033

Fix std::fs::File::metadata permission on WASI target Previously `std::fs::File::metadata` on wasm32-wasi would call `fd_filestat_get` to get metadata associated with fd, but that fd is opened without RIGHTS_FD_FILESTAT_GET right, so it will failed on correctly implemented WASI environment. This change instead to add the missing rights when opening an fd.

view details

Ralf Jung

commit sha 0a62b7dc92978b03150f58db0dd15f98069ad44e

make some vec_deque tests less exhaustive in Miri

view details

Ralf Jung

commit sha 7e168a696f23bf3bbb8b23ac83240910a92ff7a3

reduce slice::panic_safe test size further in Miri

view details

Ralf Jung

commit sha 7468f632ff4bdb34a7422dad66a548d0672c4aa1

also reduce some libcore test iteration counts

view details

Ralf Jung

commit sha ff0c3a920996ae0b09a652c1c894329f7acdc28d

expand comments

view details

Esteban Küber

commit sha 6ed06b2ba9515387957959db83dab99addbd855d

Reduce verbosity of some type ascription errors * Deduplicate type ascription LHS errors * Remove duplicated `:` -> `::` suggestion from parse error * Tweak wording to be more accurate * Modify `current_type_ascription` to reduce span wrangling * remove now unnecessary match arm * Add run-rustfix to appropriate tests

view details

Stein Somers

commit sha 240ef70c7b2a8f6833355d41001bc65b3a660eb3

Define forget_type only when relevant

view details

Stein Somers

commit sha 602f9aab89791ac2e63d0a41731ddf0a9b727f29

More benchmarks of BTreeMap mutation

view details

Stein Somers

commit sha 99398dd2fd46c24857707ee5db8c7a90f0811850

BTreeMap::drain_filter no longer touches the root during iteration

view details

Yuki Okushi

commit sha 86d0b9cbd0242b06a747b14903dfbd4fda911a1d

Do not trigger `unused_{braces,parens}` lints with `yield`

view details

Aaron Hill

commit sha 70ba491b7823c17887c6e29184f5af3f725578a3

Update elasticlunr-rs and ammonia transitive deps This removes all dependencies on pre-1.0 proc-macro ecosystem crates (syn, quote, and proc-macro2)

view details

push time in a day

pull request commentrust-lang/rust

Stabilize Ident::new_raw

@bors r+

Aaron1011

comment created time in a day

Pull request review commentrust-lang/rust

rustc_ast: Stop using "string typing" for doc comment tokens

 declare_lint_pass!(TabsInDocComments => [TABS_IN_DOC_COMMENTS]);  impl TabsInDocComments {     fn warn_if_tabs_in_doc(cx: &EarlyContext<'_>, attr: &ast::Attribute) {-        if let ast::AttrKind::DocComment(comment) = attr.kind {+        if let ast::AttrKind::DocComment(_, comment) = attr.kind {             let comment = comment.as_str();              for (lo, hi) in get_chunks_of_tabs(&comment) {                 let new_span = Span::new(-                    attr.span.lo() + BytePos(lo),-                    attr.span.lo() + BytePos(hi),+                    attr.span.lo() + BytePos(3 + lo),

/// or /**, new_span here is span without the "delimiters".

petrochenkov

comment created time in a day

pull request commentrust-lang/rust

rustc_ast: Stop using "string typing" for doc comment tokens

No regressions related to this PR. r? @Aaron1011, I guess

petrochenkov

comment created time in a day

pull request commentrust-lang/rust

Stabilize Ident::new_raw

r=me with the extra word removed and commits squashed

Aaron1011

comment created time in a day

Pull request review commentrust-lang/rust

Stabilize Ident::new_raw

 pub struct Ident(bridge::client::Ident); impl Ident {     /// Creates a new `Ident` with the given `string` as well as the specified     /// `span`.-    /// The `string` argument must be a valid identifier permitted by the-    /// language, otherwise the function will panic.+    /// The `string` argument must be either a valid identifier permitted by the
    /// The `string` argument must be a valid identifier permitted by the
Aaron1011

comment created time in a day

issue commentrust-lang/rust

Add a macro to track a file

The bare minimum would be ability to add file paths to dependencies.

However, it would be significantly more useful to also have ability to load the file into a token stream and create a source map for it, so all the spans are assigned properly.

GuillaumeGomez

comment created time in a day

pull request commentrust-lang/rust

Stabilize Ident::new_raw

FCP already happened in https://github.com/rust-lang/rust/pull/59002, so this PR shouldn't need a new one.

Aaron1011

comment created time in 2 days

Pull request review commentrust-lang/rust

Stabilize Ident::new_raw

+// force-host+// no-prefer-dynamic++#![crate_type = "proc-macro"]++extern crate proc_macro;+use proc_macro::{TokenStream, TokenTree, Ident, Punct, Spacing, Span};++#[proc_macro]+pub fn make_struct(input: TokenStream) -> TokenStream {+    match input.into_iter().next().unwrap() {+        TokenTree::Ident(ident) => {+            vec![+                TokenTree::Ident(Ident::new("struct", Span::call_site())),+                TokenTree::Ident(Ident::new_raw(&ident.to_string(), Span::call_site())),+                TokenTree::Punct(Punct::new(';', Spacing::Alone))+            ].into_iter().collect()+        }+        _ => panic!()+    }+}++#[proc_macro]+pub fn make_bad_struct(input: TokenStream) -> TokenStream {+    match input.into_iter().next().unwrap() {+        TokenTree::Ident(ident) => {+            vec![+                TokenTree::Ident(Ident::new_raw("struct", Span::call_site())),+                TokenTree::Ident(Ident::new_raw(&ident.to_string(), Span::call_site())),
                TokenTree::Ident(Ident::new(&ident.to_string(), Span::call_site())),

? (It doesn't matter much though.)

Aaron1011

comment created time in 2 days

Pull request review commentrust-lang/rust

Stabilize Ident::new_raw

 impl Ident {     }      /// Same as `Ident::new`, but creates a raw identifier (`r#ident`).-    #[unstable(feature = "proc_macro_raw_ident", issue = "54723")]+    /// The `string` argument must either be a valid identifier permitted by the language,+    /// or a keyword. Keywords which are usable in path segments (e.g. `self`, `super`)

Same as above.

Aaron1011

comment created time in 2 days

Pull request review commentrust-lang/rust

Stabilize Ident::new_raw

 impl Ident {     }      /// Same as `Ident::new`, but creates a raw identifier (`r#ident`).-    #[unstable(feature = "proc_macro_raw_ident", issue = "54723")]+    /// The `string` argument must either be a valid identifier permitted by the language,+    /// or a keyword. Keywords which are usable in path segments (e.g. `self`, `super`)+    /// are not supported, and will cause a panic.+    #[stable(feature = "proc_macro_raw_ident", since = "1.37.0")]
    #[stable(feature = "proc_macro_raw_ident", since = "1.47.0")]
Aaron1011

comment created time in 2 days

Pull request review commentrust-lang/rust

Stabilize Ident::new_raw

 pub struct Ident(bridge::client::Ident); impl Ident {     /// Creates a new `Ident` with the given `string` as well as the specified     /// `span`.-    /// The `string` argument must be a valid identifier permitted by the-    /// language, otherwise the function will panic.+    /// The `string` argument must be either a valid identifier permitted by the+    /// language, or a keyword (e.g. `self`). Otherwise, the function will panic.

must be either a valid identifier permitted by the language, or a keyword (e.g. `self`) -> must be a valid identifier permitted by the language (that includes keywords, e.g. `self`) Keywords are a subset of identifiers in the Rust model.

Aaron1011

comment created time in 2 days

PR opened rust-lang/rust

tests: Ignore src/test/debuginfo/rc_arc.rs on Windows

It requires loading pretty-printers (src\etc\gdb_load_rust_pretty_printers.py), but GDB doesn't load them on Windows.

Not sure how this passes through CI, due to an old GDB version perhaps?

+1 -0

0 comment

1 changed file

pr created time in 2 days

create barnchpetrochenkov/rust

branch : ignore-debinfo

created branch time in 2 days

PR opened rust-lang/rust

compiletest: Support ignoring tests requiring missing LLVM components

This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084.

Builds of LLVM backends take a lot of time and disk space. So it usually makes sense to build rustc with

[llvm]
targets = "X86"
experimental-targets = ""

unless you are working on some target-specific tasks.

A few tests, however, require non-x86 backends to be built. A new test directive // needs-llvm-components: component1 component2 component3 makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through llvm-config --components).

As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is

aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray

(With the default target list it's much larger.)

aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray

r? @Mark-Simulacrum

+45 -17

0 comment

15 changed files

pr created time in 2 days

create barnchpetrochenkov/rust

branch : llvmtarg

created branch time in 2 days

pull request commentrust-lang/rust

Rename rustc_middle::cstore::DepKind to CrateDepKind

r? @petrochenkov @bors r+

cjgillot

comment created time in 2 days

Pull request review commentrust-lang/rust

diagnostics: shorten paths of unique symbols

 impl<'a> Resolver<'a> {                     // otherwise cause duplicate suggestions.                     continue;                 }-                if let Some(crate_id) = self.crate_loader.maybe_process_path_extern(ident.name) {+                if let Some(crate_id) =+                    self.crate_loader.maybe_process_path_extern(ident.name, self.avoid_crate_load)

This PR should not modify anything in rustc_metadata.

If find_unique_symbols runs during any execution and not only when errors are guaranteed to happen, then it should either

  • not rely on lookup_import_candidates because it loops through the whole self.extern_prelude.
  • loop only through crates that are already loaded, using cstore.crates_untracked() or other function listing the loaded CrateNums.
da-x

comment created time in 2 days

Pull request review commentrust-lang/rust

Introduce NonterminalKind for more type-safe mbe parsing

 pub mod attr;+mod diagnostics; mod expr;+mod generics; mod item;+mod nonterminal; mod pat; mod path;-mod ty;-pub use path::PathStyle;-mod diagnostics;-mod generics; mod stmt;-use diagnostics::Error;+mod ty;  use crate::lexer::UnmatchedBrace;+use diagnostics::Error;+pub use path::PathStyle;

I don't think there's an official guideline, but the most common order is

use crate::things;

use other_crate::things;

use std::things;

mod foo;

/* Other items */
matklad

comment created time in 2 days

pull request commentrust-lang/rust

Rename rustc_middle::cstore::DepKind to DependencyKind.

It is ambiguous with DepGraph's own DepKind.

Is this a big deal? I'd rather keep this as is or rename to CrateDepKind.

cjgillot

comment created time in 2 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_span = { path = "../librustc_span" } rustc_serialize = { path = "../librustc_serialize" }+rustc_session = { path = "../librustc_session" }

No documentations, https://github.com/rust-lang/rust/pull/68133 just broke dependencies that were easily breakable.

nnethercote

comment created time in 2 days

pull request commentrust-lang/rust

Introduce NonterminalKind for more type-safe mbe parsing

@bors r+

matklad

comment created time in 2 days

pull request commentrust-lang/rust

Fix ICEs with `@ ..` binding

@bors r+

JohnTitor

comment created time in 2 days

pull request commentrust-lang/rust

Remove `GCX_PTR`.

cc https://github.com/rust-lang/rust/pull/50699 ("Blocking Rayon queries") where GCX_PTR was introduced.

r? @nikomatsakis This should ideally be reviewed by Zoxc or michaelwoerister, but neither is here.

nnethercote

comment created time in 2 days

Pull request review commentrust-lang/rust

pprust: adjust mixed comment printing and add regression test for #74745

 // Test via: rustc --pretty normal src/test/pretty/block-comment-wchar.rs // ignore-tidy-cr // ignore-tidy-tab-// pp-exact:block-comment-wchar.pp

Could you update block-comment-wchar.pp instead of removing it?

davidtwco

comment created time in 2 days

Pull request review commentrust-lang/rust

Introduce NonterminalKind for more type-safe mbe parsing

 pub enum Nonterminal { #[cfg(target_arch = "x86_64")] rustc_data_structures::static_assert_size!(Nonterminal, 40); +#[derive(Copy, Clone)]+pub enum NonterminalKind {+    Item,+    Block,+    Stmt,+    Pat,+    Expr,+    Ty,+    Ident,+    Lifetime,+    Literal,+    Meta,+    Path,+    Vis,+    TT,+}++impl NonterminalKind {+    pub fn from_symbol(symbol: Symbol) -> Option<NonterminalKind> {+        let res = match symbol {
        Some(match symbol {
matklad

comment created time in 3 days

Pull request review commentrust-lang/rust

Introduce NonterminalKind for more type-safe mbe parsing

 pub const MACRO_ARGUMENTS: Option<&'static str> = Some("macro arguments"); pub mod parser; use parser::{emit_unclosed_delims, make_unclosed_delims_error, Parser}; pub mod lexer;+pub mod nonterminal;

librustc_parse/nonterminal.rs -> librustc_parse/parser/nonterminal.rs

matklad

comment created time in 3 days

pull request commentrust-lang/rust

Deduplicate `::` -> `:` typo errors

@bors r+

estebank

comment created time in 3 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

https://github.com/rust-lang/rust/pull/74952 ended up requiring too much manual work and included some nontrivial cases, so I submitted a simpler https://github.com/rust-lang/rust/pull/75043 instead.

nnethercote

comment created time in 3 days

PR opened rust-lang/rust

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

For consistency with Attribute::has_name which doesn't mark the attribute as used either.

Replace all uses of check_name with has_name outside of rustc

cc https://github.com/rust-lang/rust/pull/74932 r? @nnethercote

+90 -89

0 comment

32 changed files

pr created time in 3 days

PR closed rust-lang/rust

[WIP] Investigate `mark_used(attr)` S-waiting-on-author

r? @ghost

+164 -155

12 comments

55 changed files

petrochenkov

pr closed time in 3 days

create barnchpetrochenkov/rust

branch : hasname

created branch time in 3 days

push eventpetrochenkov/rust

Vadim Petrochenkov

commit sha 0efc743664b02f2346c8cc02d5a0fd31101f60fa

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc

view details

Vadim Petrochenkov

commit sha 6b870d58abb24d7804f8a74635d270734f0e6e09

WIP

view details

push time in 3 days

push eventpetrochenkov/rust

Guillaume Gomez

commit sha 403164569170e3f5c06db8b66257ac61db7cff4b

Clean up E0728 explanation

view details

Andy Russell

commit sha 0b320086425937b17bda5ee9e856ac6441d71d96

report kind of deprecated item in message This is important for fields, which are incorrectly referred to as "items".

view details

Alexis Bourget

commit sha 36bb5e8a4247888c7e1ce5a06ba3aaf5dc9cafd5

Clarify the doc for MaybeUninit::zeroed on incorrect use

view details

Simon Sapin

commit sha d8bcf75206e88e07cabd95b87418fe98c5fa2b95

Make `Vec::leak` a method instead of an associated function. The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.

view details

Simon Sapin

commit sha 7d759f539f363125511f1edd9ad30934367f409b

Stabilize `Vec::leak`

view details

Guillaume Gomez

commit sha 1a6730e31ced3a7264c80c0bbdd9f42c54f1534b

Clean up E0741 error explanation

view details

Takayuki Nakata

commit sha 3e48848538a49c66e3447a46346b96e8dc972531

Some fixes for `plugin.md` in unstable-book - sample codes not working - broken link

view details

Oliver Scherer

commit sha ec7230fea2f4a96a1993c54bf2b17892d2e978b4

Move from `log` to `tracing`

view details

Oliver Scherer

commit sha 64296ec698b1c92ce148b968c101c18e63002bb2

Add tracing libs to list of permitted dependencies

view details

Oliver Scherer

commit sha 208f973d1f8ed7442a64c7784e1b4f5910722eb5

Make rustdoc share the logger initialization routine with rustc.

view details

Oliver Scherer

commit sha 720832c644d4dfe14ec43ae9ef4d74b647ccd77d

Update error index generator to tracing

view details

Oliver Scherer

commit sha 358e21ee781cbcee19ff96b3824b583611e860a5

Disable log support

view details

Oliver Scherer

commit sha 401033c68486bc7672cc87e0f4c5b4862e96c778

Don't register a tracing dispatcher if no tracing env var was set.

view details

Dan Gohman

commit sha aaffb06c041d282e4eddfd323659e76b55f3781d

Update the bundled wasi-libc with libstd This just updates WASI libc, in preparation for WASI reactor support in a separate change.

view details

Bastian Kauschke

commit sha b90bc8d70b4f2b5562314b457284e9ee9dfc89bc

fix rustdoc generic param order

view details

Valentin Lazureanu

commit sha 40e6dccfb4b0e0f21cbc846a70b348132ee4d0f2

Rename HAIR to THIR (Typed HIR).

view details

Dan Gohman

commit sha 9ade8366c076f1b40d846b5ed76c141d48beb70d

Update the WASI libc build to LLVM 10. Among other things, this brings in [the `__main_argc_argv`] patch, which simplifies the interaction between the compiler and WASI libc's startup code, which will help work on reactor support. [the `__main_argc_argv` patch]: https://github.com/llvm/llvm-project/commit/00072c08c75050ae2c835b7bb0e505475dbcd7b9

view details

Matthias Krüger

commit sha 21cab87f08604021bd031b4133287a18b18e359f

submodules: update cargo from 974eb438d to 2d5c2381e Changes: ```` Use the same index location on nightly as beta relax deprecated diagnostic message check Don't print to raw stderr in test Emit the `test` field in cargo metadata ````

view details

Oliver Scherer

commit sha aba0251c78f88b12c499ba956beb8a9734ffdc1a

Replace a recursive algorithm with an iterative one and a stack.

view details

bors

commit sha dfe1e3b641abbede6230e3931d14f0d43e5b8e54

Auto merge of #74582 - Lezzz:rename-hair, r=nikomatsakis Rename HAIR to THIR (Typed HIR). r? @nikomatsakis Originally suggested by @eddyb

view details

push time in 3 days

pull request commentrust-lang/rust

Move 'probably equal' methods to librustc_parse

r=me after rebase

Aaron1011

comment created time in 3 days

pull request commentrust-lang/rust

[WIP] Investigate `mark_used(attr)`

@bors try @rust-timer queue

petrochenkov

comment created time in 4 days

push eventpetrochenkov/rust

Aaron Hill

commit sha ac9dfc3e7785c9bba96ebac4fd51726189e1bf91

Normalize opaque types when converting `ParamEnv` to `Reveal::All` Fixes #65918

view details

Aaron Hill

commit sha 117a60e1f5045e317d3f76ce60be28d18c694608

Erase regions in try_eval_bits

view details

Aaron Hill

commit sha 90aee14eb95ac0b9ddb7cf5db6d003155e94800c

Skip computing param_env and size if not needed

view details

Aaron Hill

commit sha 5e2e927e0107916b825b164c82be44877ac6ab54

Fix rebase fallout

view details

Guillaume Gomez

commit sha 1d2e3fff69b654c3dfd6a810e193db29bb1868fa

Clean up E0730 explanation

view details

Guillaume Gomez

commit sha f22a34e84d4dba9b17bb3e68051ee82bd85f3c94

Clean up E0734 explanation

view details

Alan Somers

commit sha 013e1a6e9f73125734cb919d9b6220b3a4710d67

Enable the profiler on FreeBSD FreeBSD has been doing this in our own package builds for two months now. https://svnweb.freebsd.org/ports?view=revision&revision=535771

view details

Michal 'vorner' Vaner

commit sha ad6d63ef01e37a1a05acdba50985b01d178d7c11

Don't use "weak count" around Weak::from_raw_ptr As `Rc/Arc::weak_count` returns 0 when having no strong counts, this could be confusing and it's better to avoid using that completely. Closes #73840.

view details

David Sonder

commit sha b5d143b126cd73c873fc8feff7dee0a0b077cc84

Enable docs on dist-x86_64-musl Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

view details

Alex Crichton

commit sha 06d565c967bfb7c6ff52a991bbe47b4a2a25de3e

std: Switch from libbacktrace to gimli This commit is a proof-of-concept for switching the standard library's backtrace symbolication mechanism on most platforms from libbacktrace to gimli. The standard library's support for `RUST_BACKTRACE=1` requires in-process parsing of object files and DWARF debug information to interpret it and print the filename/line number of stack frames as part of a backtrace. Historically this support in the standard library has come from a library called "libbacktrace". The libbacktrace library seems to have been extracted from gcc at some point and is written in C. We've had a lot of issues with libbacktrace over time, unfortunately, though. The library does not appear to be actively maintained since we've had patches sit for months-to-years without comments. We have discovered a good number of soundness issues with the library itself, both when parsing valid DWARF as well as invalid DWARF. This is enough of an issue that the libs team has previously decided that we cannot feed untrusted inputs to libbacktrace. This also doesn't take into account the portability of libbacktrace which has been difficult to manage and maintain over time. While possible there are lots of exceptions and it's the main C dependency of the standard library right now. For years it's been the desire to switch over to a Rust-based solution for symbolicating backtraces. It's been assumed that we'll be using the Gimli family of crates for this purpose, which are targeted at safely and efficiently parsing DWARF debug information. I've been working recently to shore up the Gimli support in the `backtrace` crate. As of a few weeks ago the `backtrace` crate, by default, uses Gimli when loaded from crates.io. This transition has gone well enough that I figured it was time to start talking seriously about this change to the standard library. This commit is a preview of what's probably the best way to integrate the `backtrace` crate into the standard library with the Gimli feature turned on. While today it's used as a crates.io dependency, this commit switches the `backtrace` crate to a submodule of this repository which will need to be updated manually. This is not done lightly, but is thought to be the best solution. The primary reason for this is that the `backtrace` crate needs to do some pretty nontrivial filesystem interactions to locate debug information. Working without `std::fs` is not an option, and while it might be possible to do some sort of trait-based solution when prototyped it was found to be too unergonomic. Using a submodule allows the `backtrace` crate to build as a submodule of the `std` crate itself, enabling it to use `std::fs` and such. Otherwise this adds new dependencies to the standard library. This step requires extra attention because this means that these crates are now going to be included with all Rust programs by default. It's important to note, however, that we're already shipping libbacktrace with all Rust programs by default and it has a bunch of C code implementing all of this internally anyway, so we're basically already switching already-shipping functionality to Rust from C. * `object` - this crate is used to parse object file headers and contents. Very low-level support is used from this crate and almost all of it is disabled. Largely we're just using struct definitions as well as convenience methods internally to read bytes and such. * `addr2line` - this is the main meat of the implementation for symbolication. This crate depends on `gimli` for DWARF parsing and then provides interfaces needed by the `backtrace` crate to turn an address into a filename / line number. This crate is actually pretty small (fits in a single file almost!) and mirrors most of what `dwarf.c` does for libbacktrace. * `miniz_oxide` - the libbacktrace crate transparently handles compressed debug information which is compressed with zlib. This crate is used to decompress compressed debug sections. * `gimli` - not actually used directly, but a dependency of `addr2line`. * `adler32`- not used directly either, but a dependency of `miniz_oxide`. The goal of this change is to improve the safety of backtrace symbolication in the standard library, especially in the face of possibly malformed DWARF debug information. Even to this day we're still seeing segfaults in libbacktrace which could possibly become security vulnerabilities. This change should almost entirely eliminate this possibility whilc also paving the way forward to adding more features like split debug information. Some references for those interested are: * Original addition of libbacktrace - #12602 * OOM with libbacktrace - #24231 * Backtrace failure due to use of uninitialized value - #28447 * Possibility to feed untrusted data to libbacktrace - #21889 * Soundness fix for libbacktrace - #33729 * Crash in libbacktrace - #39468 * Support for macOS, never merged - ianlancetaylor/libbacktrace#2 * Performance issues with libbacktrace - #29293, #37477 * Update procedure is quite complicated due to how many patches we need to carry - #50955 * Libbacktrace doesn't work on MinGW with dynamic libs - #71060 * Segfault in libbacktrace on macOS - #71397 Switching to Rust will not make us immune to all of these issues. The crashes are expected to go away, but correctness and performance may still have bugs arise. The gimli and `backtrace` crates, however, are actively maintained unlike libbacktrace, so this should enable us to at least efficiently apply fixes as situations come up.

view details

Lzu Tao

commit sha 0374006d79114824d8eec020a9d771ca8cf712ff

Avoid bool-like naming

view details

Guillaume Gomez

commit sha 759de11f534b940f090ff94cf1829935c1eb4e7d

Clean up E0740 explanation

view details

Manish Goregaokar

commit sha abaf38ccb08d64a2a2c6b5d66dca2b58c2427664

Rename intra_doc_link_resolution_failure -> intra_doc_link_resolution_failures

view details

Manish Goregaokar

commit sha 48de8ac0416853aaf76fcbe721efe9f11e27bd9d

Rename usage of intra_doc_link_resolution_failure

view details

Manish Goregaokar

commit sha da0b10c4fb2ff230fd68e3096c467da5dd82e89e

Register renamed lint

view details

Gary Guo

commit sha 8046fea62263d50fc196ce07ccdc4534af321441

Improve diagnostics when constant pattern is too generic

view details

Gary Guo

commit sha 4e963d58c7d94270697c2765f23993e40757292f

Fix ui tests

view details

Bastian Kauschke

commit sha 870b7cbb11d799bcabc6eb5a919a27821c981bc1

improve chunks + windows err on size 0

view details

Bastian Kauschke

commit sha d405347f095a20d832261bbf777c8214d7e61dc9

adds `slice::array_chunks`

view details

Bastian Kauschke

commit sha d27007fd6d41a8e9f16228d036c1fedaf0449efd

add tests for array_chunks

view details

push time in 4 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I was wondering about that, but I had no sense of which were necessary and which weren't, so I kept them all except for the couple that I couldn't keep. It'd be great if there was a clear rule about when check_name is needed.

I started working on this and will make a PR tomorrow, most likely.

nnethercote

comment created time in 4 days

pull request commentrust-lang/rust

Re-land PR #72388: Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro`

I'll look at this case a bit later, perhaps next week.

In the meantime while https://github.com/rust-lang/rust/pull/74846 is in progress, could you extract the part of this PR that doesn't change any behavior and only moves code around (or adds tests) into a separate commit, or better separate PR? I'd r+ it immediately, and it would make clearer what this PR actually changes.

Aaron1011

comment created time in 4 days

pull request commentrust-lang/rust

[WIP] Lazy decoding of DefPathTable from crate metadata

Looks like a regression for larger crates, but win for tiny crates. (Besides the *-doc anomaly.)

Aaron1011

comment created time in 5 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I need to check a couple of things.

Blocked on https://github.com/rust-lang/rust/pull/74952.

nnethercote

comment created time in 5 days

pull request commentrust-lang/rust

[WIP] Investigate `mark_used(attr)`

@bors try @rust-timer queue

petrochenkov

comment created time in 5 days

PR opened rust-lang/rust

[WIP] Investigate `mark_used(attr)`

r? @ghost

+3 -10

0 comment

1 changed file

pr created time in 5 days

create barnchpetrochenkov/rust

branch : noused

created branch time in 5 days

pull request commentrust-lang/rust

Remove `librustc_ast` session globals

I suspect that majority of these check_names don't actually need to mark the attributes as used. So were not only doing extra work, but now also need to pass Session to locations where it shouldn't otherwise be. I need to check a couple of things.

nnethercote

comment created time in 5 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 impl<'a> CrateLoader<'a> {         self.maybe_resolve_crate(name, DepKind::Explicit, None).ok()     } }++pub fn global_allocator_spans(sess: &Session, krate: &ast::Crate) -> Vec<Span> {
fn global_allocator_spans(sess: &Session, krate: &ast::Crate) -> Vec<Span> {
nnethercote

comment created time in 5 days

Pull request review commentrust-lang/rust

Remove `librustc_ast` session globals

 rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_span = { path = "../librustc_span" } rustc_serialize = { path = "../librustc_serialize" }+rustc_session = { path = "../librustc_session" }

Removing this dependency was a conscious decision, IIRC.

nnethercote

comment created time in 5 days

pull request commentrust-lang/rust

Validate constants during `const_eval_raw`

r? @RalfJung

oli-obk

comment created time in 5 days

Pull request review commentrust-lang/rust

[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target

+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};++/// A base target for AVR devices using the GNU toolchain.+///+/// Requires GNU avr-gcc and avr-binutils on the host system.+pub fn target(target_cpu: String) -> TargetResult {+    Ok(Target {+        arch: "avr".to_string(),+        data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".to_string(),+        llvm_target: "avr-unknown-unknown".to_string(),+        target_endian: "little".to_string(),+        target_pointer_width: "16".to_string(),+        linker_flavor: LinkerFlavor::Gcc,+        target_os: "unknown".to_string(),+        target_env: "".to_string(),+        target_vendor: "unknown".to_string(),+        target_c_int_width: 16.to_string(),+        options: TargetOptions {+            cpu: target_cpu.clone(),+            exe_suffix: ".elf".to_string(),+            linker: Some("avr-gcc".to_owned()),+            pre_link_args: vec![(+                LinkerFlavor::Gcc,+                vec!["-Os".to_owned(), format!("-mmcu={}", target_cpu)],+            )]+            .into_iter()+            .collect(),+            late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lc".to_owned(), "-lgcc".to_owned()])]+                .into_iter()+                .collect(),+            ..super::freestanding_base::opts()

Could you inline this and remove freestanding_base.rs? It looks misleadingly generic, but is only used for AVR.

dylanmckay

comment created time in 5 days

Pull request review commentrust-lang/rust

[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target

+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};++/// A base target for AVR devices using the GNU toolchain.+///+/// Requires GNU avr-gcc and avr-binutils on the host system.+pub fn target(target_cpu: String) -> TargetResult {+    Ok(Target {+        arch: "avr".to_string(),+        data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".to_string(),+        llvm_target: "avr-unknown-unknown".to_string(),+        target_endian: "little".to_string(),+        target_pointer_width: "16".to_string(),+        linker_flavor: LinkerFlavor::Gcc,+        target_os: "unknown".to_string(),+        target_env: "".to_string(),+        target_vendor: "unknown".to_string(),+        target_c_int_width: 16.to_string(),+        options: TargetOptions {+            cpu: target_cpu.clone(),+            exe_suffix: ".elf".to_string(),+            linker: Some("avr-gcc".to_owned()),+            pre_link_args: vec![(+                LinkerFlavor::Gcc,+                vec!["-Os".to_owned(), format!("-mmcu={}", target_cpu)],+            )]+            .into_iter()+            .collect(),+            late_link_args: vec![(LinkerFlavor::Gcc, vec!["-lc".to_owned(), "-lgcc".to_owned()])]

Linking libc is supposed to be done through the libc crate ideally.

dylanmckay

comment created time in 5 days

Pull request review commentrust-lang/rust

[AVR] Replace broken 'avr-unknown-unknown' target with 'avr-unknown-gnu-atmega328' target

+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};++/// A base target for AVR devices using the GNU toolchain.+///+/// Requires GNU avr-gcc and avr-binutils on the host system.+pub fn target(target_cpu: String) -> TargetResult {+    Ok(Target {+        arch: "avr".to_string(),+        data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8".to_string(),+        llvm_target: "avr-unknown-unknown".to_string(),+        target_endian: "little".to_string(),+        target_pointer_width: "16".to_string(),+        linker_flavor: LinkerFlavor::Gcc,+        target_os: "unknown".to_string(),+        target_env: "".to_string(),+        target_vendor: "unknown".to_string(),+        target_c_int_width: 16.to_string(),+        options: TargetOptions {+            cpu: target_cpu.clone(),+            exe_suffix: ".elf".to_string(),+            linker: Some("avr-gcc".to_owned()),+            pre_link_args: vec![(+                LinkerFlavor::Gcc,+                vec!["-Os".to_owned(), format!("-mmcu={}", target_cpu)],

Does -Os have any effect when gcc is used as a linker only? What ld option does it translate to?

dylanmckay

comment created time in 5 days

Pull request review commentrust-lang/rust

linker: More systematic handling of CRT objects

 fn exec_linker(     } } -/// Add begin object files defined by the target spec.-fn add_pre_link_objects(cmd: &mut dyn Linker, sess: &Session, crate_type: CrateType) {-    let pre_link_objects = if crate_type == CrateType::Executable {-        &sess.target.target.options.pre_link_objects_exe-    } else {-        &sess.target.target.options.pre_link_objects_dll+fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {+    let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {+        (CrateType::Executable, false, RelocModel::Pic) => LinkOutputKind::DynamicPicExe,+        (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,+        (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe,+        (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,+        (_, true, _) => LinkOutputKind::StaticDylib,+        (_, false, _) => LinkOutputKind::DynamicDylib,     };-    for obj in pre_link_objects {-        cmd.add_object(&get_object_file_path(sess, obj));++    // Adjust the output kind to target capabilities.+    let pic_exe_supported = sess.target.target.options.position_independent_executables;+    let static_pic_exe_supported = false; // FIXME: Add this option to target specs.+    let static_dylib_supported = sess.target.target.options.crt_static_allows_dylibs;+    match kind {+        LinkOutputKind::DynamicPicExe if !pic_exe_supported => LinkOutputKind::DynamicNoPicExe,+        LinkOutputKind::StaticPicExe if !static_pic_exe_supported => LinkOutputKind::StaticNoPicExe,+        LinkOutputKind::StaticDylib if !static_dylib_supported => LinkOutputKind::DynamicDylib,

This case is here for consistency, but we should never hit it right now because if invalid_output_for_target is true then we skip the crate type and never get to linking. But if we didn't skip it (like we don't skip PIC executables when +crt-static is enabled but not supported), then we would fall back from StaticDylib to DynamicDylib.

petrochenkov

comment created time in 6 days

Pull request review commentrust-lang/rust

Replace all uses of `log::log_enabled` with `Debug` printers

 impl std::ops::Deref for CrateMetadataRef<'_> {     } } -fn dump_crates(cstore: &CStore) {-    info!("resolved crates:");-    cstore.iter_crate_data(|cnum, data| {-        info!("  name: {}", data.name());-        info!("  cnum: {}", cnum);-        info!("  hash: {}", data.hash());-        info!("  reqd: {:?}", data.dep_kind());-        let CrateSource { dylib, rlib, rmeta } = data.source();-        if let Some(dylib) = dylib {-            info!("  dylib: {}", dylib.0.display());-        }-        if let Some(rlib) = rlib {-            info!("   rlib: {}", rlib.0.display());-        }-        if let Some(rmeta) = rmeta {-            info!("   rmeta: {}", rmeta.0.display());-        }-    });+struct CrateDump<'a>(&'a CStore);++fn crate_dump(cstore: &'a CStore) -> impl std::fmt::Debug + 'a {

The function looks unnecessary, info!("{:?}", CrateDump(&self.cstore)); would be enough.

oli-obk

comment created time in 7 days

pull request commentrust-lang/rust

Capture tokens for Pat used in macro_rules! argument

@bors rollup=maybe

Aaron1011

comment created time in 7 days

pull request commentrust-lang/rust

Implement `--extern-location`

No, I'd prefer to leave this to someone else.

jsgf

comment created time in 7 days

pull request commentrust-lang/rust

Capture tokens for Pat used in macro_rules! argument

@craterbot check

Aaron1011

comment created time in 7 days

issue commentrust-lang/compiler-team

Stabilizable subset of const generics

I'm ok with this if wg-const-eval and eddyb are sure that the implementation is no longer at prototype stage, and the stabilized subset won't have issues that can't be fixed backward compatibly (due to lazy normalization, scoping of generic parameter environment, or what other problems we had).

withoutboats

comment created time in 7 days

Pull request review commentrust-lang/rust

Introduce MbeFragment

+use rustc_ast::ptr::P;+use rustc_ast::token::{self, Nonterminal, Token};+use rustc_ast_pretty::pprust;+use rustc_errors::PResult;+use rustc_span::symbol::{kw, sym, Ident, Symbol};++use crate::parser::{FollowedByType, Parser, PathStyle};++#[derive(Copy, Clone)]+pub enum MbeFragment {

FWIW, we already have this enum in token.rs, it's called enum Nonterminal, except that it has data in addition to tags. Perhaps these two enums should live together in rustc_ast as Nonterminal and NonterminalKind.

The may_begin_with is also very similar to *can_begin* functions in token.rs.

Moving the nonterminal parsing to rustc_parse is certainly a good move.

matklad

comment created time in 7 days

Pull request review commentrust-lang/rust

Introduce MbeFragment

+use rustc_ast::ptr::P;+use rustc_ast::token::{self, Nonterminal, Token};+use rustc_ast_pretty::pprust;+use rustc_errors::PResult;+use rustc_span::symbol::{kw, sym, Ident, Symbol};++use crate::parser::{FollowedByType, Parser, PathStyle};++#[derive(Copy, Clone)]+pub enum MbeFragment {

Perhaps it's also a good opportunity to try #![feature(arbitrary_enum_discriminant)].

matklad

comment created time in 7 days

pull request commentrust-lang/rust

Cache non-exhaustive separately from attributes

Implementation LGTM, waiting on perf.

Mark-Simulacrum

comment created time in 7 days

Pull request review commentrust-lang/rust

Cache non-exhaustive separately from attributes

 fn convert_variant(         adt_kind,         parent_did.to_def_id(),         recovered,+        if adt_kind == AdtKind::Struct && tcx.has_attr(parent_did.to_def_id(), sym::non_exhaustive)

Nit: adt_kind == AdtKind::Struct && tcx.has_attr(parent_did.to_def_id(), sym::non_exhaustive) || variant_did.map_or(false, |variant_did| tcx.has_attr(variant_did.to_def_id(), sym::non_exhaustive))

Mark-Simulacrum

comment created time in 7 days

Pull request review commentrust-lang/rust

Cache non-exhaustive separately from attributes

 impl<'tcx> VariantDef {     /// If someone speeds up attribute loading to not be a performance concern, they can     /// remove this hack and use the constructor `DefId` everywhere.     pub fn new(-        tcx: TyCtxt<'tcx>,+        _tcx: TyCtxt<'tcx>,

Would be good to clean this up.

Mark-Simulacrum

comment created time in 7 days

Pull request review commentrust-lang/rust

librustc_typeck: use diag item instead of string compare

 impl<'a, 'tcx> FnCtxt<'a, 'tcx> {                    on the left and may require reallocation. This \                    requires ownership of the string on the left"; -        let is_std_string = |ty| &format!("{:?}", ty) == "std::string::String";+        let string_type = self.tcx.get_diagnostic_item(sym::string_type);+        let is_std_string = |ty: Ty<'tcx>| match ty.ty_adt_def() {+            Some(ty_def) => Some(ty_def.did) == string_type,+            None => false,+        };

You could also use map_or here though.

ty.ty_adt_def().map_or(false, |adt_def| Some(adt_def.did) == string_type)
da-x

comment created time in 7 days

pull request commentrust-lang/rust

librustc_typeck: use diag item instead of string compare

@bors r+

da-x

comment created time in 7 days

pull request commentrust-lang/rust

Capture tokens for Pat used in macro_rules! argument

The equivalent change for expressions caused a large number of regressions, so this will probably need a check-only crater run, which is a bit annoying because the crater queue is full. (I would expect this change to have a more modest effect though.)

Aaron1011

comment created time in 7 days

pull request commentrust-lang/rust

Capture tokens for Pat used in macro_rules! argument

@bors try @rust-timer queue

Aaron1011

comment created time in 7 days

pull request commentrust-lang/rust

Add lint for using a type with a destructor in a zero-length repeat expr

A whole new lint for this looks like an overkill to me as well, it's better to run the destructor.

r? @RalfJung (Fell free to reassign to someone else familiar with MIR.)

Aaron1011

comment created time in 7 days

pull request commentrust-lang/rust

MinGW: enable dllexport/dllimport

@bors delegate+

mati865

comment created time in 7 days

pull request commentrust-lang/rust

MinGW: enable dllexport/dllimport

Needs a tidy fix.

mati865

comment created time in 7 days

pull request commentrust-lang/rust

cleanup: Remove duplicate library names from `Cargo.toml`s

Blocked on https://github.com/rust-lang/rust/pull/74862.

petrochenkov

comment created time in 7 days

pull request commentrust-lang/rust

[WIP] Move `rustllvm` into `librustc_llvm`

Blocked on https://github.com/rust-lang/rust/pull/74862.

petrochenkov

comment created time in 7 days

issue commentrust-lang/compiler-team

Move the compiler to a new `compiler/` directory

I'm ready to second this part:

- compiler/
  - librustc_* -> rustc_*
  - rustc/ -> bin/rustc.rs

except that rustc.rs should probably use rustc/main.rs or whatever the default cargo layout for binaries is.

mark-i-m

comment created time in 7 days

pull request commentrust-lang/rust

mv std libs to library/

@mark-i-m https://github.com/rust-lang/highfive/blob/master/highfive/configs/rust-lang/rust.json needs an update, otherwise all library PRs will be assigned to nikomatsakis.

@RalfJung git rebase should handle this automatically in most cases.

mark-i-m

comment created time in 8 days

pull request commentrust-lang/rust

[WIP] Move almost all compiler crates to compiler/

LGTM. I had some reservations regarding llvm (including #74787) and tests, but they are not moved here.

Do you plan to introduce the inner src directories though? They were added to library but not here.

mark-i-m

comment created time in 8 days

Pull request review commentrust-lang/rust

[WIP] Move almost all compiler crates to compiler/

 [workspace] members = [   "src/bootstrap",-  "src/rustc",-  "src/librustc_codegen_llvm",+  "compiler/bin",+  "compiler/rustc_codegen_llvm",

rustc_codegen_llvm is no longer necessary here, AFAIK.

mark-i-m

comment created time in 8 days

pull request commentrust-lang/rust

mv std libs to library/

move small bits at a time for compiler/ move, to avoid this pain

Or have hardware to build and test locally. This PR would be much less "heroic" if done by e.g. someone from the infra team from the start.

mark-i-m

comment created time in 8 days

pull request commentrust-lang/rust

Capture tokens for Pat used in macro_rules! argument

r? @petrochenkov

Aaron1011

comment created time in 8 days

pull request commentrust-lang/rust

Re-land PR #72388: Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro`

Excellent, r=me after rebasing and addressing the two remaining comments.

Aaron1011

comment created time in 8 days

Pull request review commentrust-lang/rust

MinGW: enable dllexport/dllimport

 impl<'a> Linker for GccLinker<'a> {             return;         } +        let is_windows = self.sess.target.target.options.is_like_windows;         let mut arg = OsString::new();-        let path = tmpdir.join("list");+        let path = tmpdir.join(if is_windows { "list.def" } else { "list" });

Ok, if there are any doubts then it can stay as is.

mati865

comment created time in 8 days

pull request commentrust-lang/rust

report kind of deprecated item in message

@bors r+

euclio

comment created time in 9 days

pull request commentrust-lang/rust

Encode trait impls using nested Tables

It would be great if @eddyb could review this.

Aaron1011

comment created time in 9 days

pull request commentrust-lang/rust

Encode trait impls using nested Tables

This is relevant to perf regressions in https://github.com/rust-lang/rust/pull/74682.

Aaron1011

comment created time in 9 days

pull request commentrust-lang/rust

Serialize span hygiene data

Missing // no-prefer-dynamic in make-macro.rs maybe?

Aaron1011

comment created time in 9 days

pull request commentrust-lang/rust

[WIP] Move `rustllvm` into `librustc_llvm`

cc interested parties @cuviper @nikic @bjorn3 @eddyb @mark-i-m (I could forget someone else)

petrochenkov

comment created time in 9 days

PR opened rust-lang/rust

[WIP] Move `rustllvm` into `librustc_llvm`

The rustllvm directory is not self-contained, it contains C++ code built by a build script of the rustc_llvm crate which is then linked into that crate. So it makes sense to make rustllvm a part of rustc_llvm and move it into its directory. I replaced rustllvm with more obvious llvm-wrapper as the subdirectory name, but something like llvm-adapter would work as well, other suggestions are welcome.

To make things more confusing, the Rust side of FFI functions defined in rustllvm can be found in librustc_codegen_llvm rather than in rustc_llvm. Perhaps they need to be moved as well, but this PR doesn't do that.

The presence of multiple LLVM-related directories in src (llvm-project, rustllvm, librustc_llvm, librustc_codegen_llvm and their predecessors) historically confused me and made me wonder about their purpose. With this PR we will have LLVM itself (llvm-project), a FFI crate (librustc_llvm, kind of llvm-sys) and a codegen backend crate using LLVM through the FFI crate (librustc_codegen_llvm).

If this is merged, then the merge should probably be done after the compiler part of https://github.com/rust-lang/compiler-team/issues/316 to avoid moving things around twice.

+10 -11

0 comment

12 changed files

pr created time in 9 days

create barnchpetrochenkov/rust

branch : rustllvm

created branch time in 9 days

PR opened rust-lang/highfive

rust-lang/rust: Assign reviews to all active compiler team members and contributors

Implement the suggestion from https://github.com/rust-lang/highfive/pull/266#issuecomment-647040858 and increases the number of assignable people from 9 to 22.

Highfive uses a check based on git blame to increase the change of the selected reviewer being familiar with the code.

Excluded from the list:

  • matklad, flodiebold - work on rust-analyzer but not rustc
  • lqd - works on polonius but not rustc, also inactive?
  • zackmdavis, scalexm - inactive

r? @nikomatsakis

+6 -3

0 comment

1 changed file

pr created time in 9 days

push eventpetrochenkov/highfive

Mark Rousskov

commit sha 3b290170a6178e02b1d4f3b96ebc54c1e34bff40

Merge pull request #277 from petrochenkov/compiler rust-lang/rust: Some outdated entry removal and cleanup

view details

Vadim Petrochenkov

commit sha 63678fc7443bc7ecb412a4723ebd356e6f31e645

rust-lang/rust: Assign reviews to all active compiler team members and contributors

view details

push time in 9 days

Pull request review commentrust-lang/rust

Deduplicate `::` -> `:` typo errors

 impl<'a> LateResolutionVisitor<'a, '_, '_> {     fn type_ascription_suggestion(&self, err: &mut DiagnosticBuilder<'_>, base_span: Span) {         let sm = self.r.session.source_map();         let base_snippet = sm.span_to_snippet(base_span);-        if let Some(sp) = self.diagnostic_metadata.current_type_ascription.last() {-            let mut sp = *sp;-            loop {-                // Try to find the `:`; bail on first non-':' / non-whitespace.-                sp = sm.next_point(sp);-                if let Ok(snippet) = sm.span_to_snippet(sp.to(sm.next_point(sp))) {-                    let line_sp = sm.lookup_char_pos(sp.hi()).line;-                    let line_base_sp = sm.lookup_char_pos(base_span.lo()).line;-                    if snippet == ":" {-                        let mut show_label = true;-                        if line_sp != line_base_sp {-                            err.span_suggestion_short(-                                sp,-                                "did you mean to use `;` here instead?",-                                ";".to_string(),+        if let Some(&sp) = self.diagnostic_metadata.current_type_ascription.last() {+            if let Ok(snippet) = sm.span_to_snippet(sp) {+                let len = snippet.trim_end().len() as u32;+                if snippet.trim() == ":" {+                    let colon_sp =+                        sp.with_lo(sp.lo() + BytePos(len - 1)).with_hi(sp.lo() + BytePos(len));+                    let mut show_label = true;+                    if sm.is_multiline(sp) {+                        err.span_suggestion_short(+                            colon_sp,+                            "maybe you meant to write `;` here",+                            ";".to_string(),+                            Applicability::MaybeIncorrect,+                        );+                    } else {+                        let after_colon_sp =+                            self.get_colon_suggestion_span(colon_sp.shrink_to_hi());+                        if snippet.len() == 1 {+                            // `foo:bar`+                            err.span_suggestion(+                                colon_sp,+                                "maybe you meant to write a path separator here",+                                "::".to_string(),                                 Applicability::MaybeIncorrect,                             );-                        } else {-                            let colon_sp = self.get_colon_suggestion_span(sp);-                            let after_colon_sp =-                                self.get_colon_suggestion_span(colon_sp.shrink_to_hi());-                            if !sm-                                .span_to_snippet(after_colon_sp)-                                .map(|s| s == " ")-                                .unwrap_or(false)+                            show_label = false;+                            if self+                                .r+                                .session+                                .parse_sess+                                .type_ascription_path_suggestions+                                .borrow()+                                .contains(&colon_sp)

We can check the result of insert below instead of doing this contains check.

estebank

comment created time in 9 days

more