about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-10-18Guarantee that `char` has the same size and alignment as `u32`Joshua Liebow-Feeser-1/+4
2023-10-18Auto merge of #116885 - aliemjay:rollup-plbeppt, r=aliemjaybors-140/+272
Rollup of 5 pull requests Successful merges: - #116812 (Disable missing_copy_implementations lint on non_exhaustive types) - #116856 (Disable effects in libcore again) - #116865 (Suggest constraining assoc types in more cases) - #116870 (Don't compare host param by name) - #116879 (revert #114586) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-18Rollup merge of #116879 - aliemjay:revert-opaque-bubble, r=oli-obkAli MJ Al-Nasrawy-84/+100
revert #114586 Reverts #114586. cc #116877 (not closing until this gets a beta backport) fixes #116684 fixes https://github.com/rust-lang/rust/pull/114586#issuecomment-1751967321 r? `@oli-obk` or `@lcnr`
2023-10-18Rollup merge of #116870 - compiler-errors:host-param-by-name, r=fee1-deadAli MJ Al-Nasrawy-11/+10
Don't compare host param by name Seems sketchy to be searching for `sym::host` by name, especially when we can get the actual index with not very much work. r? fee1-dead
2023-10-18Rollup merge of #116865 - estebank:issue-46969, r=compiler-errorsAli MJ Al-Nasrawy-44/+102
Suggest constraining assoc types in more cases Fix #46969. ``` error[E0308]: mismatched types --> $DIR/suggest-contraining-assoc-type-because-of-assoc-const.rs:12:21 | LL | const N: C::M = 4u8; | ^^^ expected associated type, found `u8` | = note: expected associated type `<C as O>::M` found type `u8` help: consider constraining the associated type `<C as O>::M` to `u8` | LL | impl<C: O<M = u8>> U<C> for u16 { | ++++++++ ```
2023-10-18Rollup merge of #116856 - oli-obk:no_effects, r=compiler-errorsAli MJ Al-Nasrawy-1/+30
Disable effects in libcore again r? `@fee1-dead` This was accidentally allowed by https://github.com/rust-lang/rust/pull/114776 without feature gates
2023-10-18Rollup merge of #116812 - ↵Ali MJ Al-Nasrawy-0/+30
rmehri01:missing_copy_implementations_non_exhaustive, r=petrochenkov Disable missing_copy_implementations lint on non_exhaustive types Fixes #116766
2023-10-18Auto merge of #116815 - Nilstrieb:more-funny-pretty-printers, r=compiler-errorsbors-310/+214
Remove lots of generics from `ty::print` All of these generics mostly resolve to the same thing, which means we can remove them, greatly simplifying the types involved in pretty printing and unlocking another simplification (that is not performed in this PR): Using `&mut self` instead of passing `self` through the return type. cc `@eddyb` you probably know why it's like this, just checking in and making sure I didn't do anything bad r? oli-obk
2023-10-18Auto merge of #116814 - estebank:windows-ice-path, r=petrochenkovbors-3/+14
Use `YYYY-MM-DDTHH_MM_SS` as datetime format for ICE dump files Windows paths do not support `:`, so use a datetime format in ICE dump paths that Windows will accept. CC #116809, fix #115180.
2023-10-18revert rust-lang/rust#114586Ali MJ Al-Nasrawy-84/+100
2023-10-18Auto merge of #116713 - estebank:issue-116703, r=compiler-errorsbors-98/+588
Properly account for self ty in method disambiguation suggestion Fix #116703.
2023-10-18Auto merge of #116830 - nnethercote:rustc_type_ir, r=compiler-errorsbors-128/+41
Remove `IdFunctor` trait. It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed. r? `@BoxyUwU`
2023-10-18Don't compare host param by nameMichael Goulet-11/+10
2023-10-18Auto merge of #116505 - saethlin:infer-inline, r=cjgillotbors-350/+457
Automatically enable cross-crate inlining for small functions This is basically reviving https://github.com/rust-lang/rust/pull/70550 The `#[inline]` attribute can have a significant impact on code generation or runtime performance (because it enables inlining between CGUs where it would normally not happen) and also on compile-time performance (because it enables MIR inlining). But it has to be added manually, which is awkward. This PR factors whether a DefId is cross-crate inlinable into a query, and replaces all uses of `CodegenFnAttrs::requests_inline` with this new query. The new query incorporates all the other logic that is used to determine whether a Def should be treated as cross-crate-inlinable, and as a last step inspects the function's optimized_mir to determine if it should be treated as cross-crate-inlinable. The heuristic implemented here is deliberately conservative; we only infer inlinability for functions whose optimized_mir does not contain any calls or asserts. I plan to study adjusting the cost model later, but for now the compile time implications of this change are so significant that I think this very crude heuristic is well worth landing.
2023-10-18Auto merge of #116840 - nikic:update-llvm-15, r=cuviperbors-0/+0
Update to LLVM 17.0.3 Fixes https://github.com/rust-lang/rust/issues/116582. Fixes miscompile reported at https://github.com/rust-lang/rust/pull/104862. r? `@cuviper`
2023-10-17Bless coverage-map testsBen Kimock-6/+23
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-344/+434
2023-10-17Suggest constraining assoc types in more casesEsteban Küber-44/+102
Fix #46969.
2023-10-17Auto merge of #116767 - cjgillot:alloc-normalize, r=oli-obkbors-326/+361
Normalize alloc-id in tests. AllocIds are globally numbered in a rustc invocation. This makes them very sensitive to changes unrelated to what is being tested. This commit normalizes them by renumbering, in order of appearance in the output. The renumbering allows to keep the identity, that a simple `allocN` wouldn't. This is useful when we have memory dumps. cc `@saethlin` r? `@oli-obk`
2023-10-17Auto merge of #116855 - matthiaskrgr:rollup-i2izdwb, r=matthiaskrgrbors-284/+1905
Rollup of 5 pull requests Successful merges: - #111072 (Add new simpler and more explicit syntax for check-cfg) - #116717 (Special case iterator chain checks for suggestion) - #116719 (Add MonoItems and Instance to stable_mir) - #116787 (Implement an internal lint encouraging use of `Span::eq_ctxt`) - #116827 (Make `handle_options` public again.) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-17Disable effects in libcore againOli Scherer-1/+30
2023-10-17Unify suggestion wordingEsteban Küber-168/+145
2023-10-17review comments + more testsEsteban Küber-20/+421
2023-10-17Properly account for self ty in method disambiguation suggestionEsteban Küber-3/+115
Fix #116703.
2023-10-17Use `YYYY-MM-DDTHH_MM_SS` as datetime format for ICE dump filesEsteban Küber-3/+14
Windows paths do not support `:`, so use a datetime format in ICE dump paths that Windows will accept. Fix #116809, fix #115180.
2023-10-17Rollup merge of #116827 - nnethercote:pub-handle_options, r=compiler-errorsMatthias Krüger-1/+5
Make `handle_options` public again. r? ``@compiler-errors``
2023-10-17Rollup merge of #116787 - a-lafrance:span-internal-lint, r=oli-obkMatthias Krüger-21/+89
Implement an internal lint encouraging use of `Span::eq_ctxt` Adds a new Rustc internal lint that forbids use of `.ctxt() == .ctxt()` for spans, encouraging use of `.eq_ctxt()` instead (see https://github.com/rust-lang/rust/issues/49509). Also fixed a few violations of the lint in the Rustc codebase (a fun additional way I could test my code). Edit: MIR opt folks I believe that's why you're CC'ed, just a heads up. Two things I'm not sure about: 1. The way I chose to detect calls to `Span::ctxt`. I know adding diagnostic items to methods is generally discouraged, but after some searching and experimenting I couldn't find anything else that worked, so I went with it. That said, I'm happy to implement something different if there's a better way out there. (For what it's worth, if there is a better way, it might be worth documenting in the rustc-dev-guide, which I'm happy to take care of) 2. The error message for the lint. Ideally it would probably be good to give some context as to why the suggestion is made (e.g. `rustc::default_hash_types` tells the user that it's because of performance), but I don't have that context so I couldn't put it in the error message. Happy to iterate on the error message based on feedback during review. r? ``@oli-obk``
2023-10-17Rollup merge of #116719 - celinval:smir-mono, r=oli-obkMatthias Krüger-45/+401
Add MonoItems and Instance to stable_mir Also add a few methods to instantiate instances and get an instance definition. We're still missing support to actually monomorphize the instance body. This is related to https://github.com/rust-lang/project-stable-mir/issues/36 r? ``@oli-obk`` ``@oli-obk`` is that what you were thinking? I incorporated ``@bjorn3`` idea of just adding a Shim instance definition in https://github.com/rust-lang/rust/pull/116465.
2023-10-17Rollup merge of #116717 - estebank:issue-9082, r=oli-obkMatthias Krüger-1/+393
Special case iterator chain checks for suggestion When encountering method call chains of `Iterator`, check for trailing `;` in the body of closures passed into `Iterator::map`, as well as calls to `<T as Clone>::clone` when `T` is a type param and `T: !Clone`. Fix #9082.
2023-10-17Rollup merge of #111072 - Urgau:check-cfg-new-syntax, r=petrochenkovMatthias Krüger-216/+1017
Add new simpler and more explicit syntax for check-cfg <details> <summary> Old proposition (before the MCP) </summary> This PR adds a new simpler and more explicit syntax for check-cfg. It consist of two new form: - `exhaustive(names, values)` - `configure(name, "value1", "value2", ... "valueN")` The preview forms `names(...)` and `values(...)` have implicit meaning that are not strait-forward. In particular `values(foo)`&`values(bar)` and `names(foo, bar)` are not equivalent which has created [some confusions](https://github.com/rust-lang/rust/pull/98080). Also the `names()` and `values()` form are not clear either and again created some confusions where peoples believed that `values()`&`values(foo)` could be reduced to just `values(foo)`. To fix that the two new forms are made to be explicit and simpler. See the table of correspondence: - `names()` -> `exhaustive(names)` - `values()` -> `exhaustive(values)` - `names(foo)` -> `exhaustive(names)`&`configure(foo)` - `values(foo)` -> `configure(foo)` - `values(feat, "foo", "bar")` -> `configure(feat, "foo", "bar")` - `values(foo)`&`values(bar)` -> `configure(foo, bar)` - `names()`&`values()`&`values(my_cfg)` -> `exhaustive(names, values)`&`configure(my_cfg)` Another benefits of the new syntax is that it allow for further options (like conditional checking for --cfg, currently always on) without syntax change. The two previous forms are deprecated and will be removed once cargo and beta rustc have the necessary support. </details> This PR is the first part of the implementation of [MCP636 - Simplify and improve explicitness of the check-cfg syntax](https://github.com/rust-lang/compiler-team/issues/636). ## New `cfg` form It introduces the new [`cfg` form](https://github.com/rust-lang/compiler-team/issues/636) and deprecate the other two: ``` rustc --check-cfg 'cfg(name1, ..., nameN, values("value1", "value2", ... "valueN"))' ``` ## Default built-in names and values It also changes the default for the built-in names and values checking. - Built-in values checking would always be activated as long as a `--check-cfg` argument is present - Built-in names checking would always be activated as long as a `--check-cfg` argument is present **unless** if any `cfg(any())` arg is passed ~~**Note: depends on https://github.com/rust-lang/rust/pull/111068 but is reviewable (last two commits)!**~~ Resolve https://github.com/rust-lang/compiler-team/issues/636 r? `@petrochenkov`
2023-10-17Auto merge of #116844 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 17 commits in 6fa6fdc7606cfa664f9bee2fb33ee2ed904f4e88..ff768b45b302efd488178b31b35489e4fabb8799 2023-10-10 23:06:08 +0000 to 2023-10-17 12:51:31 +0000 - Clarify flag behavior in `cargo remove --help` (rust-lang/cargo#12823) - doc(cargo-login): mention args after `--` in manpage (rust-lang/cargo#12832) - changelog: add compat notice for `cargo login -- &lt;arg&gt;` (rust-lang/cargo#12830) - update SPDX License info (rust-lang/cargo#12827) - Add test for `-V` short argument (rust-lang/cargo#12822) - add detailed message when target folder path is invalid (rust-lang/cargo#12820) - chore(deps): update rust crate toml_edit to 0.20.2 (rust-lang/cargo#12761) - Support `public` dependency configuration with workspace deps (rust-lang/cargo#12817) - Update rustix to 0.38.18 (rust-lang/cargo#12815) - contrib docs: add some conveniences (rust-lang/cargo#12812) - Better suggestion for unsupported `--path` flag (rust-lang/cargo#12811) - contrib docs: update rfc and roadmap links (rust-lang/cargo#12814) - contrib doc: remove extraneous word (rust-lang/cargo#12813) - Update curl-sys to pull in curl 8.4.0 (rust-lang/cargo#12808) - feat: add package name and version to warning messages (rust-lang/cargo#12799) - Do not call it "Downgrading" when difference is only build metadata (rust-lang/cargo#12796) - Add unsupported short flag suggestion for `--target` and `--exclude` flags (rust-lang/cargo#12805) r? ghost
2023-10-17Remove `Print::Error`Nilstrieb-32/+17
All printing goes through `fmt::Error` now.
2023-10-17Remove `Printer::Error`Nilstrieb-194/+180
It's always a `fmt::Error` except in some cases where it was `!`, but we're not really winning anything in that case.
2023-10-17Remove `Print::Output`Nilstrieb-43/+27
Now that `Printer` doesn't have subprinters anymore, the output of a printing operation is always the same.
2023-10-17Remove "subprinter" types from `Printer`Nilstrieb-200/+149
These are `Self` in almost all printers except one, which can just store the state as a field instead. This simplifies the printer and allows for further simplifications, for example using `&mut self` instead of passing around the printer.
2023-10-17disable missing_copy_implementations lint on non_exhaustive typesRyan Mehri-0/+30
use is_variant_list_non_exhaustive/is_field_list_non_exhaustive remove unused tcx inline non_exhaustive def/variant check
2023-10-17Update cargoWeihang Lo-0/+0
2023-10-17Auto merge of #115577 - RalfJung:atomic-load, r=Amanieubors-0/+34
document when atomic loads are guaranteed read-only Based on this [discussion in Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Can.20.60Atomic*.3A.3Aload.60.20perform.20a.20write). The values for x86 and x86_64 are complete guesswork on my side, and I have no clue what the values might be for other architectures. I hope we can get the right people to chime in to gather the required information. :) I'll update Miri to respect these rules once we have more data.
2023-10-17Auto merge of #116756 - fee1-dead-contrib:dupe-those-bounds, r=oli-obkbors-40/+661
Duplicate `~const` bounds with a non-const one in effects desugaring This should unblock #116058. r? `@oli-obk`
2023-10-17Auto merge of #116518 - vita-rust:vita, r=workingjubileebors-109/+40
Updated libc and doc for Vita target Doc changes: - Updated Vita target readme. The recommended approach to build artifacts for the platform now is [cargo-vita](https://crates.io/crates/cargo-vita) which wraps all the convoluted steps previously described in a yaml for `cargo-make` - Updated maintainer list for Vita target. (`@ZetaNumbers` `@pheki` please agree to be added to the list, `@amg98` please let us know if you're still planning on actively maintaining target support) Code changes: - ~Updated libc for rust-lang/libc#3284 and rust-lang/libc#3366~ (Already merged in #116527) - In dupfd changed the flag same as for esp target, there is no CLOEXEC on Vita - Enabled `new_pair` since we've implemented `socketpair` in Vita newlib
2023-10-17Update to LLVM 17.0.3Nikita Popov-0/+0
2023-10-17Auto merge of #116196 - onur-ozkan:reorganize-bootstrap-sources, ↵bors-508/+530
r=Mark-Simulacrum reorganize/refactor bootstrap codebase Currently, bootstrap stores everything on the root path, including very large modules, which makes things very hard to scale and adds too much complexity. This PR has the following objectives: - Improving scalability. - Making bootstrap source more understandable for the new contributors(or for everyone). - Improving the development experience and making maintenance easier for the bootstrap team. The new source structure: ``` . ├── defaults │   ├── README.md │   ├── config.codegen.toml │   ├── config.compiler.toml │   ├── config.dist.toml │   ├── config.library.toml │   └── config.tools.toml ├── mk │   └── Makefile.in ├── src │   ├── bin │   │   ├── main.rs │   │   ├── rustc.rs │   │   ├── rustdoc.rs │   │   └── sccache-plus-cl.rs │   ├── core │   │   ├── build_steps │   │   │   ├── check.rs │   │   │   ├── clean.rs │   │   │   ├── compile.rs │   │   │   ├── dist.rs │   │   │   ├── doc.rs │   │   │   ├── format.rs │   │   │   ├── install.rs │   │   │   ├── llvm.rs │   │   │   ├── mod.rs │   │   │   ├── run.rs │   │   │   ├── setup.rs │   │   │   ├── suggest.rs │   │   │   ├── synthetic_targets.rs │   │   │   ├── test.rs │   │   │   ├── tool.rs │   │   │   └── toolstate.rs │   │   ├── config │   │   │   ├── config.rs │   │   │   ├── flags.rs │   │   │   └── mod.rs │   │   ├── builder.rs │   │   ├── download.rs │   │   ├── metadata.rs │   │   ├── mod.rs │   │   └── sanity.rs │   ├── tests │   │   ├── builder.rs │   │   ├── config.rs │   │   └── setup.rs │   ├── utils │   │   ├── bin_helpers.rs │   │   ├── cache.rs │   │   ├── cc_detect.rs │   │   ├── channel.rs │   │   ├── dylib.rs │   │   ├── helpers.rs │   │   ├── job.rs │   │   ├── metrics.rs │   │   ├── mod.rs │   │   ├── render_tests.rs │   │   └── tarball.rs │   └── lib.rs ├── Cargo.lock ├── Cargo.toml ├── README.md ├── bootstrap.py ├── bootstrap_test.py ├── build.rs ├── configure.py └── download-ci-llvm-stamp ``` The next step involves: - Adding more doc-comments to the bootstrap internals (although we already have a decent amount, there is space for improvement). - Breaking large modules into smaller, more manageable modules. - Significantly increasing our unit test coverage (which is currently lacking). This PR should serve as an initial step to make the tasks above much more easier. r? Mark-Simulacrum
2023-10-17Updated libc and doc for Vita targetNikolay Arhipov-109/+40
2023-10-17bootstrap: fix warningsonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17rename bootstrap module utils/dylib_util->utils/dylibonur-ozkan-4/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap utils into bootstrap/src/utils moduleonur-ozkan-861/+297
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-189/+792
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17improve bootstrap tests structureonur-ozkan-10/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17reorganize bootstrap bins and helper module utilizationsonur-ozkan-35/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17Auto merge of #116824 - notriddle:master, r=fmeasebors-0/+53
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 3) Follow up * https://github.com/rust-lang/rust/pull/116214 * https://github.com/rust-lang/rust/pull/116432