about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-07Mark Boxy as on vacationMichael Goulet-0/+1
2024-10-07Auto merge of #131354 - matthiaskrgr:rollup-hprnng2, r=matthiaskrgrbors-128/+53
Rollup of 4 pull requests Successful merges: - #131331 (Revert "warn_old_master_branch" check) - #131344 (Avoid `&Lrc<T>` in various places) - #131346 (Restrict `ignore-mode-*` directives) - #131353 (Add documentation for `runtest::check_rustdoc_test_option` method) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-07Rollup merge of #131353 - GuillaumeGomez:check_rustdoc_test_option, r=jieyouxuMatthias Krüger-0/+4
Add documentation for `runtest::check_rustdoc_test_option` method r? `@jieyouxu`
2024-10-07Rollup merge of #131346 - jieyouxu:prune-invalid-directives, r=ZalatharMatthias Krüger-21/+3
Restrict `ignore-mode-*` directives This is only used by coverage test suites where the same sources get run under different coverage modes. Restrict `ignore-mode-<coverage_mode>` to only coverage modes.
2024-10-07Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errorsMatthias Krüger-39/+45
Avoid `&Lrc<T>` in various places Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better. r? `@oli-obk`
2024-10-07Rollup merge of #131331 - onur-ozkan:131296, r=KobzolMatthias Krüger-68/+1
Revert "warn_old_master_branch" check See https://github.com/rust-lang/rust/issues/131296#issuecomment-2395486918. Reverts https://github.com/rust-lang/rust/pull/130121 and https://github.com/rust-lang/rust/pull/129584. Fixes https://github.com/rust-lang/rust/issues/131296 and https://github.com/rust-lang/rust/issues/131324.
2024-10-07Add documentation for `runtest::check_rustdoc_test_option` methodGuillaume Gomez-0/+4
2024-10-07Auto merge of #131235 - ↵bors-191/+186
codemountains:rename-nestedmetaitem-to-metaitemlnner, r=nnethercote Rename `NestedMetaItem` to `MetaItemInner` Fixes #131087 r? `@nnethercote`
2024-10-07Rename nested_meta to meta_item_innercodemountains-22/+23
2024-10-07Auto merge of #131345 - Zalathar:rollup-scdxuou, r=Zalatharbors-163/+195
Rollup of 3 pull requests Successful merges: - #128399 (liballoc: introduce String, Vec const-slicing) - #131308 (enable f16 and f128 on windows-gnullvm targets) - #131325 (coverage: Multiple small tweaks to counter creation) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-07Prune invalid `ignore-mode-*` directives许杰友 Jieyou Xu (Joe)-21/+3
These are only valid for coverage test modes.
2024-10-07Rollup merge of #131325 - Zalathar:tweak-counters, r=jieyouxuStuart Cook-25/+28
coverage: Multiple small tweaks to counter creation I've been experimenting with some larger changes to how coverage counters are assigned to parts of the control-flow graph, and while none of that is ready yet, along the way I've repeatedly found myself wanting these smaller tweaks as a base. There are no changes to compiler output.
2024-10-07Rollup merge of #131308 - mati865:gnullvm-f16-f128, r=tgross35Stuart Cook-2/+3
enable f16 and f128 on windows-gnullvm targets Continuation of https://github.com/rust-lang/rust/pull/130959
2024-10-07Rollup merge of #128399 - mammothbane:master, r=Amanieu,tgross35Stuart Cook-136/+164
liballoc: introduce String, Vec const-slicing This change `const`-qualifies many methods on `Vec` and `String`, notably `as_slice`, `as_str`, `len`. These changes are made behind the unstable feature flag `const_vec_string_slice`. ## Motivation This is to support simultaneous variance over ownership and constness. I have an enum type that may contain either `String` or `&str`, and I want to produce a `&str` from it in a possibly-`const` context. ```rust enum StrOrString<'s> { Str(&'s str), String(String), } impl<'s> StrOrString<'s> { const fn as_str(&self) -> &str { match self { // In a const-context, I really only expect to see this variant, but I can't switch the implementation // in some mode like #[cfg(const)] -- there has to be a single body Self::Str(s) => s, // so this is a problem, since it's not `const` Self::String(s) => s.as_str(), } } } ``` Currently `String` and `Vec` don't support this, but can without functional changes. Similar logic applies for `len`, `capacity`, `is_empty`. ## Changes The essential thing enabling this change is that `Unique::as_ptr` is `const`. This lets us convert `RawVec::ptr` -> `Vec::as_ptr` -> `Vec::as_slice` -> `String::as_str`. I had to move the `Deref` implementations into `as_{str,slice}` because `Deref` isn't `#[const_trait]`, but I would expect this change to be invisible up to inlining. I moved the `DerefMut` implementations as well for uniformity.
2024-10-07Auto merge of #131226 - nnethercote:rustc_infer-cleanups, r=lcnrbors-195/+90
`rustc_infer` cleanups Various small improvements I found while reading over this code. r? `@lcnr`
2024-10-07Avoid another `&Lrc<..>` in a return value.Nicholas Nethercote-2/+3
2024-10-07Remove an unnecessary `&Lrc<_>` local variable.Nicholas Nethercote-3/+2
2024-10-07Convert a `&Lrc<T>` argument to `Lrc<T>`.Nicholas Nethercote-4/+12
It's slightly simpler.
2024-10-07Convert `Option<&Lrc<T>>` return types to `Option<&T>`.Nicholas Nethercote-30/+28
It's simpler and more concise.
2024-10-07Auto merge of #131068 - RalfJung:immediate-offset-sanity-check, r=nnethercotebors-46/+76
Don't use Immediate::offset to transmute pointers to integers This applies the relatively new `assert_matches_abi` check in the `offset` operation on immediates, which makes sure that if offsets are used to alter the layout (which is possible because the field layout is arbitrarily picked by the caller), this is not done in a way that breaks the invariant of the `Immediate` type. This leads to ICEs in a GVN mir-opt test, so the second commit fixes GVN. Fixes https://github.com/rust-lang/rust/issues/131064.
2024-10-06liballoc: introduce String, Vec const-slicingNathan Perry-136/+164
This change `const`-qualifies many methods on Vec and String, notably `as_slice`, `as_str`, `len`. These changes are made behind the unstable feature flag `const_vec_string_slice` with the following tracking issue: https://github.com/rust-lang/rust/issues/129041
2024-10-07Remove out-of-date comment.Nicholas Nethercote-2/+0
2024-10-07Move a `use` statement so it's with the other `use` statements.Nicholas Nethercote-2/+1
2024-10-07Simplify two matches.Nicholas Nethercote-24/+2
Matches involving `GenericArgKind` pairs typically use a single `_` for the impossible case. This commit shortens two verbose matches in this way.
2024-10-07Streamline `next_*_var*` methods.Nicholas Nethercote-18/+6
Inline and remove `next_const_var_id`, `next_int_var_id`, `next_float_var_id`, all of which have a single call site.
2024-10-07Inline and remove `InferCtxtBuilder::with_defining_opaque_types`.Nicholas Nethercote-10/+3
It has a single use.
2024-10-07Fix `FIXME` comment on `FixupError`.Nicholas Nethercote-27/+24
`FixupError` is isomorphic with `TyOrConstInferVar`, so this commit changes it to just be a wrapper around `TyOrConstInferVar`. Also, move the `Display` impl for `FixupError` next to `FixupError`.
2024-10-07Remove `InferCtxt::err_count_on_creation`.Nicholas Nethercote-30/+3
It's no longer used meaningfully. This also means `DiagCtxtHandle::err_count_excluding_lint_errs` can be removed.
2024-10-07Reduce visibilities some more.Nicholas Nethercote-25/+26
It helps people reading the code understand how widely things are used.
2024-10-07Remove unused `UnitResult` type.Nicholas Nethercote-2/+0
2024-10-07Reduce visibilities.Nicholas Nethercote-52/+25
Three of the modules don't need to be `pub`, and then `warn(unreachable_pub)` identifies a bunch more things that also shouldn't be `pub`, plus a couple of things that are unused.
2024-10-07Rename `errors/mod.rs` as `errors.rs`.Nicholas Nethercote-0/+0
It's simpler, for this tiny module.
2024-10-07Remove unused features.Nicholas Nethercote-3/+0
2024-10-06Auto merge of #128651 - folkertdev:naked-asm-macro-v2, r=Amanieubors-519/+551
add `naked_asm!` macro for use in `#[naked]` functions tracking issue: https://github.com/rust-lang/rust/issues/90957 Adds the `core::arch::naked_asm` macro, to be used in `#[naked]` functions, but providing better error messages and a place to explain the restrictions on assembly in naked functions. This PR does not yet require that the `naked_asm!` macro is used inside of `#[naked]` functions: - the `asm!` macro can still be used in `#[naked]` functions currently, with the same restrictions and error messages as before. - the `naked_asm!` macro can be used outside of `#[naked]` functions. It has not yet been decided whether that should be allowed long-term. In this PR, the parsing code of `naked_asm!` now enforces the restrictions on assembly in naked functions, with the exception of checking that the `noreturn` option is specified. It also has not currently been decided if `noreturn` should be implicit or not. This PR looks large because it touches a bunch of tests. The code changes are mostly straightforward I think: we now have 3 flavors of assembly macro, and that information must be propagated through the parsing code and error messages. cc `@Lokathor` r? `@Amanieu`
2024-10-06Auto merge of #131337 - matthiaskrgr:rollup-j37xn8o, r=matthiaskrgrbors-6/+22
Rollup of 4 pull requests Successful merges: - #131001 (add clarity for custom path installation) - #131307 (Android: Debug assertion after setting thread name) - #131322 (Update out-dated link) - #131335 (grammar fix) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-06Rollup merge of #131335 - dacianpascu06:fix-typo, r=joboetMatthias Krüger-1/+1
grammar fix
2024-10-06Rollup merge of #131322 - mu001999-contrib:cleanup/invalid-url, r=jieyouxuMatthias Krüger-1/+1
Update out-dated link
2024-10-06Rollup merge of #131307 - YohDeadfall:prctl-set-name-dbg-assert, ↵Matthias Krüger-1/+3
r=workingjubilee Android: Debug assertion after setting thread name While `prctl` cannot fail if it points to a valid buffer, it's still better to assert the result as it's done for other places.
2024-10-06Rollup merge of #131001 - iyernaveenr:naveen_iyer/installation_clarity, ↵Matthias Krüger-3/+17
r=onur-ozkan add clarity for custom path installation install.sysconfdir is another value, in addition to install.prefix, that could be set for custom path installation.
2024-10-06grammar fixdacian-1/+1
2024-10-06various fixes for `naked_asm!` implementationFolkert de Vries-73/+116
- fix for divergence - fix error message - fix another cranelift test - fix some cranelift things - don't set the NORETURN option for naked asm - fix use of naked_asm! in doc comment - fix use of naked_asm! in run-make test - use `span_bug` in unreachable branch
2024-10-06Auto merge of #129670 - est31:cfg_attr_crate_type_name_error, r=Urgaubors-118/+60
Make deprecated_cfg_attr_crate_type_name a hard error Turns the forward compatibility lint added by #83744 into a hard error, so now, while the `#![crate_name]` and `#![crate_type]` attributes are still allowed in raw form, they are now forbidden to be nested inside a `#![cfg_attr()]` attribute. The following will now be an error: ```Rust #![cfg_attr(foo, crate_name = "foobar")] #![cfg_attr(foo, crate_type = "bin")] ``` This code will continue working and is not deprecated: ```Rust #![crate_name = "foobar"] #![crate_type = "lib"] ``` The reasoning for this is explained in #83744: it allows us to not have to cfg-expand in order to determine the crate's type and name. As of filing the PR, exactly two years have passed since #99784 has been merged, which has turned the lint's default warning level into an error, so there has been ample time to move off the now-forbidden syntax. cc #91632 - tracking issue for the lint
2024-10-06remove checks that are now performed during macro expansion of `naked_asm!`Folkert de Vries-66/+8
2024-10-06more `asm!` -> `naked_asm!` in testsFolkert de Vries-23/+22
2024-10-06disallow `asm!` in `#[naked]` functionsFolkert de Vries-297/+222
also disallow the `noreturn` option, and infer `naked_asm!` as `!`
2024-10-06use `naked_asm!` in feature-gate-naked_functions testFolkert-12/+45
2024-10-06use `naked_asm!` in naked-function testsFolkert-43/+63
2024-10-06use `naked_asm!` in `tests/ui/asm/naked-functions.rs`Folkert-139/+117
2024-10-06implement `naked_asm` macroFolkert-68/+160
2024-10-06Revert "Rollup merge of #129584 - lolbinarycat:old-upstream-warning, ↵onur-ozkan-46/+1
r=albertlarsan68" This reverts commit 776187d2c9a42dc07452ae36a8b765d66bd8e2ca, reversing changes made to 7d015575ada1de8a4627fcdea416194a57a175c2.