| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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
|
|
Add documentation for `runtest::check_rustdoc_test_option` method
r? `@jieyouxu`
|
|
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.
|
|
Avoid `&Lrc<T>` in various places
Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better.
r? `@oli-obk`
|
|
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.
|
|
|
|
codemountains:rename-nestedmetaitem-to-metaitemlnner, r=nnethercote
Rename `NestedMetaItem` to `MetaItemInner`
Fixes #131087
r? `@nnethercote`
|
|
|
|
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
|
|
These are only valid for coverage test modes.
|
|
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.
|
|
enable f16 and f128 on windows-gnullvm targets
Continuation of https://github.com/rust-lang/rust/pull/130959
|
|
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.
|
|
`rustc_infer` cleanups
Various small improvements I found while reading over this code.
r? `@lcnr`
|
|
|
|
|
|
It's slightly simpler.
|
|
It's simpler and more concise.
|
|
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.
|
|
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
|
|
|
|
|
|
Matches involving `GenericArgKind` pairs typically use a single `_` for
the impossible case. This commit shortens two verbose matches in this
way.
|
|
Inline and remove `next_const_var_id`, `next_int_var_id`,
`next_float_var_id`, all of which have a single call site.
|
|
It has a single use.
|
|
`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`.
|
|
It's no longer used meaningfully.
This also means `DiagCtxtHandle::err_count_excluding_lint_errs` can be
removed.
|
|
It helps people reading the code understand how widely things are used.
|
|
|
|
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.
|
|
It's simpler, for this tiny module.
|
|
|
|
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`
|
|
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
|
|
grammar fix
|
|
Update out-dated link
|
|
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.
|
|
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.
|
|
|
|
- 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
|
|
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
|
|
|
|
|
|
also disallow the `noreturn` option, and infer `naked_asm!` as `!`
|
|
|
|
|
|
|
|
|
|
r=albertlarsan68"
This reverts commit 776187d2c9a42dc07452ae36a8b765d66bd8e2ca, reversing
changes made to 7d015575ada1de8a4627fcdea416194a57a175c2.
|