-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 12 pull requests #126016
Rollup of 12 pull requests #126016
Commits on May 13, 2024
-
Add
size_of
,size_of_val
,align_of
, andalign_of_val
to the p……relude Many, many projects use `size_of` to get the size of a type. However, it's also often equally easy to hardcode a size (e.g. `8` instead of `size_of::<u64>()`). Minimizing friction in the use of `size_of` helps ensure that people use it and make code more self-documenting. The name `size_of` is unambiguous: the name alone, without any prefix or path, is self-explanatory and unmistakeable for any other functionality. Adding it to the prelude cannot produce any name conflicts, as any local definition will silently shadow the one from the prelude. Thus, we don't need to wait for a new edition prelude to add it. Add `size_of_val`, `align_of`, and `align_of_val` as well, with similar justification: widely useful, self-explanatory, unmistakeable for anything else, won't produce conflicts.
Configuration menu - View commit details
-
Copy full SHA for a5a60d7 - Browse repository at this point
Copy the full SHA a5a60d7View commit details
Commits on May 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b4834a1 - Browse repository at this point
Copy the full SHA b4834a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for d553d5b - Browse repository at this point
Copy the full SHA d553d5bView commit details
Commits on Jun 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8530285 - Browse repository at this point
Copy the full SHA 8530285View commit details
Commits on Jun 3, 2024
-
Allow static mut definitions with #[linkage]
Unlike static declarations with #[linkage], for definitions rustc doesn't rewrite it to add an extra indirection.
Configuration menu - View commit details
-
Copy full SHA for 07dc3eb - Browse repository at this point
Copy the full SHA 07dc3ebView commit details
Commits on Jun 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8f08625 - Browse repository at this point
Copy the full SHA 8f08625View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9957b9 - Browse repository at this point
Copy the full SHA e9957b9View commit details -
bootstrap: implement new feature
bootstrap-self-test
Some of the bootstrap logics should be ignored during unit tests because they either make the tests take longer or cause them to fail. Therefore we need to be able to exclude them from the bootstrap when it's called by unit tests. This change introduces a new feature called `bootstrap-self-test`, which is enabled on bootstrap unit tests by default. This allows us to keep the logic separate between compiler builds and bootstrap tests without needing messy workarounds (like checking if target names match those in the unit tests). Signed-off-by: onur-ozkan <work@onurozkan.dev>
Configuration menu - View commit details
-
Copy full SHA for 8f677e8 - Browse repository at this point
Copy the full SHA 8f677e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bad3d1 - Browse repository at this point
Copy the full SHA 2bad3d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 59e2074 - Browse repository at this point
Copy the full SHA 59e2074View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d26f58 - Browse repository at this point
Copy the full SHA 5d26f58View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac96fa4 - Browse repository at this point
Copy the full SHA ac96fa4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec8fa17 - Browse repository at this point
Copy the full SHA ec8fa17View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a21937 - Browse repository at this point
Copy the full SHA 2a21937View commit details
Commits on Jun 5, 2024
-
UNICODE_ARRAY
andASCII_ARRAY
fixes.- Avoid unnecessary escaping of single quotes within string literals. - Add a missing blank line between two `UNICODE_ARRAY` sections.
Configuration menu - View commit details
-
Copy full SHA for e1ae0fa - Browse repository at this point
Copy the full SHA e1ae0faView commit details -
Don't use the word "parse" for lexing operations.
Lexing converts source text into a token stream. Parsing converts a token stream into AST fragments. This commit renames several lexing operations that have "parse" in the name. I think these names have been subtly confusing me for years. This is just a `s/parse/lex/` on function names, with one exception: `parse_stream_from_source_str` becomes `source_str_to_stream`, to make it consistent with the existing `source_file_to_stream`. The commit also moves that function's location in the file to be just above `source_file_to_stream`. The commit also cleans up a few comments along the way.
Configuration menu - View commit details
-
Copy full SHA for d1215da - Browse repository at this point
Copy the full SHA d1215daView commit details -
Inline and remove
error_malformed_cfg_attr_missing
.It has a single call site. This also means `CFG_ATTR_{GRAMMAR_HELP,NOTE_REF}` can be moved into `parse_cfg_attr`, now that it's the only function that uses them. And the commit removes the line break in the URL.
Configuration menu - View commit details
-
Copy full SHA for f657624 - Browse repository at this point
Copy the full SHA f657624View commit details -
Rename
maybe_file_to_stream
asmaybe_source_file_to_stream
.Because it takes an `Lrc<SourceFile>`, and for consistency with `source_file_to_stream`.
Configuration menu - View commit details
-
Copy full SHA for 769ca3f - Browse repository at this point
Copy the full SHA 769ca3fView commit details -
It's a zero-value wrapper of `Parser::new`.
Configuration menu - View commit details
-
Copy full SHA for 3c321b9 - Browse repository at this point
Copy the full SHA 3c321b9View commit details -
- Convert it from a macro to a function, which is nicer. - Rename it as `unwrap_or_emit_fatal`, which is clearer. - Fix the comment. In particular, `panictry!` no longer exists. - Remove the unnecessary `use` declaration.
Configuration menu - View commit details
-
Copy full SHA for af13b48 - Browse repository at this point
Copy the full SHA af13b48View commit details -
The first one is out-of-date -- there are no longer functions expr, item, stmt. And I don't know what a "HOF" is. The second one doesn't really tell you anything.
Configuration menu - View commit details
-
Copy full SHA for 29e6e28 - Browse repository at this point
Copy the full SHA 29e6e28View commit details -
Rename
maybe_source_file_to_parser
as `maybe_new_parser_from_source……_file`. For consistency with `new_parser_from_{file,source_str}` and `maybe_new_parser_from_source_str`.
Configuration menu - View commit details
-
Copy full SHA for 191b76e - Browse repository at this point
Copy the full SHA 191b76eView commit details -
Use
source_str_to_stream
in a test file.It does exactly what is required.
Configuration menu - View commit details
-
Copy full SHA for 8964106 - Browse repository at this point
Copy the full SHA 8964106View commit details -
Inline and remove
parse_crate{,_attrs}_from_{file,source_str}
.All four functions are simple and have a single call site. This requires making `Parser::parse_inner_attributes` public, which is no big deal.
Configuration menu - View commit details
-
Copy full SHA for 25972ae - Browse repository at this point
Copy the full SHA 25972aeView commit details -
Reorder
source_str_to_stream
arguments.It's the only one of these functions where `psess` isn't the first argument.
Configuration menu - View commit details
-
Copy full SHA for ab192a0 - Browse repository at this point
Copy the full SHA ab192a0View commit details -
Inline and remove
source_file_to_stream
.It has a single call site.
Configuration menu - View commit details
-
Copy full SHA for 264dbe4 - Browse repository at this point
Copy the full SHA 264dbe4View commit details -
Make top-level
rustc_parse
functions fallible.Currently we have an awkward mix of fallible and infallible functions: ``` new_parser_from_source_str maybe_new_parser_from_source_str new_parser_from_file (maybe_new_parser_from_file) // missing (new_parser_from_source_file) // missing maybe_new_parser_from_source_file source_str_to_stream maybe_source_file_to_stream ``` We could add the two missing functions, but instead this commit removes of all the infallible ones and renames the fallible ones leaving us with these which are all fallible: ``` new_parser_from_source_str new_parser_from_file new_parser_from_source_file source_str_to_stream source_file_to_stream ``` This requires making `unwrap_or_emit_fatal` public so callers of formerly infallible functions can still work. This does make some of the call sites slightly more verbose, but I think it's worth it for the simpler API. Also, there are two `catch_unwind` calls and one `catch_fatal_errors` call in this diff that become removable thanks this change. (I will do that in a follow-up PR.)
Configuration menu - View commit details
-
Copy full SHA for b903733 - Browse repository at this point
Copy the full SHA b903733View commit details -
rustfmt: Remove an unnecessary
catch_unwind
use.The `Input::File` and `Input::Text` cases should be very similar. However, currently the `Input::File` case uses `catch_unwind` because, until recently (rust-lang#125815) there was a fallible version of `new_parser_from_source_str` but only an infallible version of `new_parser_from_file`. This difference wasn't fundamental, just an overlooked gap in the API of `rustc_parse`. Both of those operations are now fallible, so the `Input::File` and `Input::Text` cases can made more similar, with no need for `catch_unwind`. This also lets us simplify an `Option<Vec<Diag>>` to `Vec<Diag>`.
Configuration menu - View commit details
-
Copy full SHA for 2d4e7df - Browse repository at this point
Copy the full SHA 2d4e7dfView commit details -
Add another test for hidden types capturing lifetimes that outlive bu…
…t arent mentioned in substs
Configuration menu - View commit details
-
Copy full SHA for dd6bca5 - Browse repository at this point
Copy the full SHA dd6bca5View commit details -
Rollup merge of rust-lang#123168 - joshtriplett:size-of-prelude, r=Am…
…anieu Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude (Note: need to update the PR to add `align_of` and `align_of_val`, and remove the second commit with the myriad changes to appease the lint.) Many, many projects use `size_of` to get the size of a type. However, it's also often equally easy to hardcode a size (e.g. `8` instead of `size_of::<u64>()`). Minimizing friction in the use of `size_of` helps ensure that people use it and make code more self-documenting. The name `size_of` is unambiguous: the name alone, without any prefix or path, is self-explanatory and unmistakeable for any other functionality. Adding it to the prelude cannot produce any name conflicts, as any local definition will silently shadow the one from the prelude. Thus, we don't need to wait for a new edition prelude to add it.
Configuration menu - View commit details
-
Copy full SHA for 9ccc7b7 - Browse repository at this point
Copy the full SHA 9ccc7b7View commit details -
Rollup merge of rust-lang#125273 - onur-ozkan:bootstrap-self-test, r=…
…albertlarsan68 bootstrap: implement new feature `bootstrap-self-test` Some of the bootstrap logics should be ignored during unit tests because they either make the tests take longer or cause them to fail. Therefore we need to be able to exclude them from the bootstrap when it's called by unit tests. This change introduces a new feature called `bootstrap-self-test`, which is enabled on bootstrap unit tests by default. This allows us to keep the logic separate between compiler builds and bootstrap tests without needing messy workarounds (like checking if target names match those in the unit tests). Also, resolves rust-lang#122090 (without having to create separate modules)
Configuration menu - View commit details
-
Copy full SHA for 0f86182 - Browse repository at this point
Copy the full SHA 0f86182View commit details -
Rollup merge of rust-lang#125683 - Oneirical:patience-testing-test, r…
…=jieyouxu Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Some oddly specific ignore flags in `incr-prev-body-beyond-eof`: ```rs // ignore-none // ignore-nvptx64-nvidia-cuda ``` it could be interesting to run a try job, but it seems there is no nvidia-cuda in the CI settings (`jobs.yml`). try-job: armhf-gnu
Configuration menu - View commit details
-
Copy full SHA for 0f2b34a - Browse repository at this point
Copy the full SHA 0f2b34aView commit details -
Rollup merge of rust-lang#125815 - nnethercote:rustc_parse-top-level-…
…cleanups, r=spastorino `rustc_parse` top-level cleanups A bunch of improvements in and around `compiler/rustc_parse/src/lib.rs`. Many of the changes streamline the API in that file from this (12 functions and one macro): ``` name args return type ---- ---- ----------- panictry_buffer! Result<T, Vec<Diag>> T pub parse_crate_from_file path PResult<Crate> pub parse_crate_attrs_from_file path PResult<AttrVec> pub parse_crate_from_source_str name,src PResult<Crate> pub parse_crate_attrs_from_source_str name,src PResult<AttrVec> pub new_parser_from_source_str name,src Parser pub maybe_new_parser_from_source_str name,src Result<Parser, Vec<Diag>> pub new_parser_from_file path,error_sp Parser maybe_source_file_to_parser srcfile Result<Parser, Vec<Diag>> pub parse_stream_from_source_str name,src,override_sp TokenStream pub source_file_to_stream srcfile,override_sp TokenStream maybe_file_to_stream srcfile,override_sp Result<TokenStream, Vec<Diag>> pub stream_to_parser stream,subparser_name Parser ``` to this: ``` name args return type ---- ---- ----------- unwrap_or_emit_fatal Result<T, Vec<Diag>> T pub new_parser_from_source_str name,src Result<Parser, Vec<Diag>> pub new_parser_from_file path,error_sp Result<Parser, Vec<Diag>> new_parser_from_source_file srcfile Result<Parser, Vec<Diag>> pub source_str_to_stream name,src,override_sp Result<TokenStream, Vec<Diag>> source_file_to_stream srcfile,override_sp Result<TokenStream, Vec<Diag>> ``` I found the old API quite confusing, with lots of similar-sounding function names and no clear structure. I think the new API is much better. r? `@spastorino`
Configuration menu - View commit details
-
Copy full SHA for 05b4674 - Browse repository at this point
Copy the full SHA 05b4674View commit details -
Rollup merge of rust-lang#125903 - petrochenkov:upctxt3, r=nnethercote
rustc_span: Inline some hot functions Found while benchmarking rust-lang#125829.
Configuration menu - View commit details
-
Copy full SHA for 0096138 - Browse repository at this point
Copy the full SHA 0096138View commit details -
Rollup merge of rust-lang#125906 - compiler-errors:simplify-method-er…
…ror-args, r=fmease Remove a bunch of redundant args from `report_method_error` Rebased on top of rust-lang#125397 because I had originally asked there (rust-lang#125397 (comment)) for this change to be made, but I just chose to do it myself. r? fmease
Configuration menu - View commit details
-
Copy full SHA for 78d9a7e - Browse repository at this point
Copy the full SHA 78d9a7eView commit details -
Rollup merge of rust-lang#125920 - bjorn3:allow_static_mut_linkage_de…
…f, r=Urgau Allow static mut definitions with #[linkage] Unlike static declarations with #[linkage], for definitions rustc doesn't rewrite it to add an extra indirection. This was accidentally disallowed in rust-lang#125046. cc rust-lang#125800 (comment)
Configuration menu - View commit details
-
Copy full SHA for 2b89c1b - Browse repository at this point
Copy the full SHA 2b89c1bView commit details -
Rollup merge of rust-lang#125982 - xTachyon:fix-linked-list, r=jhpratt
Make deleting on LinkedList aware of the allocator Fixed rust-lang#125950
Configuration menu - View commit details
-
Copy full SHA for 448159c - Browse repository at this point
Copy the full SHA 448159cView commit details -
Rollup merge of rust-lang#125995 - kpreid:const-uninit-stable, r=Nils…
…trieb Use inline const blocks to create arrays of `MaybeUninit`. This PR contains 2 changes enabled by the fact that [`inline_const` is now stable](rust-lang#104087), and was split out of rust-lang#125082. 1. Use inline const instead of `unsafe` to construct arrays in `MaybeUninit` examples. Rationale: Demonstrate good practice of avoiding `unsafe` code where it is not strictly necessary. 4. Use inline const instead of `unsafe` to implement `MaybeUninit::uninit_array()`. This is arguably giving the compiler more work to do, in exchange for eliminating just one single internal unsafe block, so it's less certain that this is good on net. r? `@Nilstrieb`
Configuration menu - View commit details
-
Copy full SHA for 6b6b698 - Browse repository at this point
Copy the full SHA 6b6b698View commit details -
Rollup merge of rust-lang#125996 - tmiasko:closure-recursively-reacha…
…ble, r=oli-obk Closures are recursively reachable Fixes rust-lang#126012.
Configuration menu - View commit details
-
Copy full SHA for eb2819e - Browse repository at this point
Copy the full SHA eb2819eView commit details -
Rollup merge of rust-lang#126003 - Lokathor:new-co-maintainer, r=comp…
…iler-errors Add a co-maintainer for the two ARMv4T targets This adds a second maintainer to the `armv4t-none-eabi` and `thumbv4t-none-eabi` targets, a necessary step on the path to Tier 2
Configuration menu - View commit details
-
Copy full SHA for 669935e - Browse repository at this point
Copy the full SHA 669935eView commit details -
Rollup merge of rust-lang#126004 - compiler-errors:captures-soundness…
…-test, r=lcnr Add another test for hidden types capturing lifetimes that outlive but arent mentioned in substs Another test to make sure future implementations of rust-lang#116040 don't have any subtle unsoundness 🤔 r? types
Configuration menu - View commit details
-
Copy full SHA for f12fe3a - Browse repository at this point
Copy the full SHA f12fe3aView commit details