about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-06-05Port `tests/run-make-fulldeps/issue-19371` to ui-fulldepsZalathar-0/+10
2024-06-04Update dist.rsChosenName-2/+5
2024-06-04Update config.rsChosenName-2/+4
2024-06-04fmtChosenName-2/+6
2024-06-04Fix typosChosenName-2/+2
2024-06-04Update config.rsChosenName-6/+14
2024-06-04Update package.jsonChosenName-1392/+2198
2024-06-04Update cargoWeihang Lo-0/+0
2024-06-05rustfmt: Remove an unnecessary `catch_unwind` use.Nicholas Nethercote-15/+8
The `Input::File` and `Input::Text` cases should be very similar. However, currently the `Input::File` case uses `catch_unwind` because, until recently (#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>`.
2024-06-05Make top-level `rustc_parse` functions fallible.Nicholas Nethercote-6/+8
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.)
2024-06-05Remove `stream_to_parser`.Nicholas Nethercote-2/+2
It's a zero-value wrapper of `Parser::new`.
2024-06-04docs: add README.md for build_helperWeihang Lo-0/+3
2024-06-04Rollup merge of #125930 - weihanglo:opt-dist-respect-cargo-config, r=KobzolGuillaume Gomez-2/+25
feat(opt-dist): new flag `--benchmark-cargo-config` This should be the last piece toward self-contained `opt-dist` (I believe). The flag propagates cargo configs to `rustc-perf --cargo-config`, which is particularly useful when the environment is air-gapped, and you want to use the default set of training crates vendored in the rustc-src tarball. It fixes the issue described in #125465 > * The current pinned rustc-perf uses `tempfile::Tempdir` as the working directory when collecting profiles from some of these packages. This "tmp" working directory usage make it impossible for Cargo to pick up the correct vendor sources setting in `.cargo/config.toml` bundled in the rustc-src tarball. [^1] > [^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173 See also * <https://github.com/rust-lang/rustc-perf/pull/1913> * <https://github.com/rust-lang/rust/pull/125465> * https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/tempfile.20in.20rustc-perf.20make.20it.20hard.20to.20configure.20vendor r​? Kobzol
2024-06-04rewrite suspicious-library in rmakeOneirical-1/+1
2024-06-04Create `run-make` `env_var` and `env_var_os` helpersGuillaume Gomez-34/+44
2024-06-04Add safe/unsafe to static inside extern blocksSantiago Pastorino-1/+3
2024-06-04Handle safety keyword for extern block inner itemsSantiago Pastorino-1/+4
2024-06-04Give test a more useful nameOli Scherer-1/+0
2024-06-04Move tests to a more appropriate directoryOli Scherer-1/+1
2024-06-04Show that it will pick up the entirely wrong function as a private candidateOli Scherer-1/+1
2024-06-04Use dyn cache for Semantics macro resolutionLukas Wirth-41/+44
2024-06-04Cache parse trees in `Semantics`Lukas Wirth-4/+22
2024-06-04Cache `file_to_def` in `SourceToDefCtx`Lukas Wirth-28/+40
2024-06-04Try caching macro calls more aggressivelyLukas Wirth-303/+385
2024-06-04Auto merge of #17341 - Veykril:inert-attr, r=Veykrilbors-162/+155
internal: Cleanup some inert attribute stuff
2024-06-04Cleanup some inert attribute stuffLukas Wirth-162/+155
2024-06-04Auto merge of #17282 - jkelleyrtp:jk/filter-by-underscorte, r=Veykrilbors-1/+29
Feat: hide double underscored symbols from symbol search Fixes #17272 by changing the default behavior of query to skip results that start with `__` (two underscores). Not sure if this has any far reaching implications - a review would help to understand if this is the right place to do the filtering, and if it's fine to do it by default on the query. If you type `__` as your search, then we'll show the matching double unders, just in case you actually need the symbol.
2024-06-04Recognize `__` prefixes for symbol search queryLukas Wirth-16/+8
2024-06-04Rollup merge of #125750 - compiler-errors:expect, r=lcnr许杰友 Jieyou Xu (Joe)-8/+8
Align `Term` methods with `GenericArg` methods, add `Term::expect_*` * `Term::ty` -> `Term::as_type`. * `Term::ct` -> `Term::as_const`. * Adds `Term::expect_type` and `Term::expect_const`, and uses them in favor of `.ty().unwrap()`, etc. I could also shorten these to `as_ty` and then do `GenericArg::as_ty` as well, but I do think the `as_` is important to signal that this is a conversion method, and not a getter, like `Const::ty` is. r? types
2024-06-03Add more ABI test cases.Lokathor-2/+14
2024-06-04Auto merge of #125380 - compiler-errors:wc-obj-safety, r=oli-obkbors-34/+0
Make `WHERE_CLAUSES_OBJECT_SAFETY` a regular object safety violation #### The issue In #50781, we have known about unsound `where` clauses in function arguments: ```rust trait Impossible {} trait Foo { fn impossible(&self) where Self: Impossible; } impl Foo for &() { fn impossible(&self) where Self: Impossible, {} } // `where` clause satisfied for the object, meaning that the function now *looks* callable. impl Impossible for dyn Foo {} fn main() { let x: &dyn Foo = &&(); x.impossible(); } ``` ... which currently segfaults at runtime because we try to call a method in the vtable that doesn't exist. :( #### What did u change This PR removes the `WHERE_CLAUSES_OBJECT_SAFETY` lint and instead makes it a regular object safety violation. I choose to make this into a hard error immediately rather than a `deny` because of the time that has passed since this lint was authored, and the single (1) regression (see below). That means that it's OK to mention `where Self: Trait` where clauses in your trait, but making such a trait into a `dyn Trait` object will report an object safety violation just like `where Self: Sized`, etc. ```rust trait Impossible {} trait Foo { fn impossible(&self) where Self: Impossible; // <~ This definition is valid, just not object-safe. } impl Foo for &() { fn impossible(&self) where Self: Impossible, {} } fn main() { let x: &dyn Foo = &&(); // <~ THIS is where we emit an error. } ``` #### Regressions From a recent crater run, there's only one crate that relies on this behavior: https://github.com/rust-lang/rust/pull/124305#issuecomment-2122381740. The crate looks unmaintained and there seems to be no dependents. #### Further We may later choose to relax this (e.g. when the where clause is implied by the supertraits of the trait or something), but this is not something I propose to do in this FCP. For example, given: ``` trait Tr { fn f(&self) where Self: Blanket; } impl<T: ?Sized> Blanket for T {} ``` Proving that some placeholder `S` implements `S: Blanket` would be sufficient to prove that the same (blanket) impl applies for both `Concerete: Blanket` and `dyn Trait: Blanket`. Repeating here that I don't think we need to implement this behavior right now. ---- r? lcnr
2024-06-03Revert "Rollup merge of #125472 - erikdesjardins:component, r=clubby789"Erik Desjardins-34/+0
This reverts commit 64730a1632f4b13923ee32782cd4718613aea9a3, reversing changes made to 80aea305d388bd39a1bb5d92212de8fbde100c97.
2024-06-03Align Term methods with GenericArg methodsMichael Goulet-8/+8
2024-06-03feat(opt-dist): new flag `--benchmark-cargo-config`Weihang Lo-2/+25
The flag propagates cargo configs to `rustc-perf --cargo-config`, which is particularly useful when the environment is air-gapped, and you want to use the default set of training crates vendored in the rustc-src tarball.
2024-06-03Auto merge of #125383 - Oneirical:bundle-them-up, r=jieyouxubors-5/+2
Rewrite `emit`, `mixing-formats` and `bare-outfile` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-msvc
2024-06-03Add fuel to `find_path`Lukas Wirth-1/+15
2024-06-03Remove an allocation in `find_path::find_local_import_locations`Lukas Wirth-23/+17
2024-06-03SimplifyLukas Wirth-33/+31
2024-06-03DeduplicateLukas Wirth-30/+20
2024-06-03Fix find_path search not reducing scope appropriately for foreign itemsLukas Wirth-12/+18
2024-06-03SimplifyLukas Wirth-149/+113
2024-06-03chore: update src/tools/rustc-perfWeihang Lo-0/+0
This is needed for fixing the missing license issue. See https://github.com/rust-lang/rust/pull/125465.
2024-06-03Make WHERE_CLAUSES_OBJECT_SAFETY a regular object safety violationMichael Goulet-34/+0
2024-06-03Opt-in diagnostics reporting to avoid doing extra work in the new solverMichael Goulet-1/+1
2024-06-03Auto merge of #17329 - Nilstrieb:rustc_deprecated_safe_2024, r=Veykrilbors-0/+23
Don't mark `#[rustc_deprecated_safe_2024]` functions as unsafe `std::env::set_var` will be unsafe in edition 2024, but not before it. I couldn't quite figure out how to check for the span properly, so for now we just turn the false positives into false negatives, which are less bad.
2024-06-03Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykrilbors-79/+71
style: simplify string interpolation
2024-06-03Auto merge of #17312 - regexident:function-fn-ptr-type, r=Veykrilbors-0/+8
Add `Function::fn_ptr_type(…)` for obtaining name-erased function type The use case of this function if being able to group functions by their function ptr type. cc `@flodiebold`
2024-06-03Auto merge of #17333 - DropDemBits:extract-format-args-snippet-cap, r=Veykrilbors-68/+189
fix: Only generate snippets for `extract_expressions_from_format_string` if snippets are supported Part of #17332 Fixes `extract_expressions_from_format_string` so that it doesn't generate snippets if the client doesn't support it.
2024-06-03Auto merge of #125912 - nnethercote:rustfmt-tests-mir-opt, r=oli-obkbors-18/+24
rustfmt `tests/mir-opt` Continuing the work started in #125759. Details in individual commit log messages. r? `@oli-obk`
2024-06-03Add translation support by mdbook-i18n-helpers to bootstrapdalance-0/+14