| Age | Commit message (Collapse) | Author | Lines |
|
Rewrite `inline` attribute parser to use new infrastructure and improve diagnostics for all parsed attributes
r? `@oli-obk`
This PR:
- creates a new parser for inline attributes
- creates consistent error messages and error codes between attribute parsers; inline and others
- as such changes a few error messages for other attributes to be (in my eyes) much more consistent
- tests ast-lowering lints introduced by rust-lang/rust#138164 since this is now useful for the first time
- Coalesce some useless error codes
Builds on top of rust-lang/rust#138164
Closes rust-lang/rust#137950
|
|
Rewrite `inline` attribute parser to use new infrastructure and improve diagnostics for all parsed attributes
r? `@oli-obk`
This PR:
- creates a new parser for inline attributes
- creates consistent error messages and error codes between attribute parsers; inline and others
- as such changes a few error messages for other attributes to be (in my eyes) much more consistent
- tests ast-lowering lints introduced by rust-lang/rust#138164 since this is now useful for the first time
- Coalesce some useless error codes
Builds on top of rust-lang/rust#138164
Closes rust-lang/rust#137950
|
|
|
|
|
|
|
|
|
|
Those lints share the detection logic structure, but differed, probably
because of an oversight, in lint emission: only one of them would take
care of emitting parentheses around the suggestion if required.
Factor the code into one function which checks for the right condition
and emits the lint in an identical way.
|
|
To limit false positives, the `range_plus_one` and `range_minus_one` lints
will restrict themselves to situations where the iterator types can be easily
switched from exclusive to inclusive or vice-versa. This includes situations
where the range is used as an iterator, or is used for indexing. Also,
when the range is used as a function or method call argument and the
parameter type is generic over traits implemented by both kind of
ranges, the lint will trigger.
On the other hand, assignments of the range to variables, including
automatically typed ones or wildcards, will no longer trigger the lint.
However, the cases where such an assignment would benefit from the lint
are probably rare.
This fix doesn't prevent false positives from happening. A more complete
fix would check if the obligations can be satisfied by the new proposed
range type.
|
|
|
|
Safer implementation of RepeatN
I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs.
Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`.
This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
|
|
|
|
Another refactor pulled out from 138759
The previous implementation I'd written here based on `index_by_increasing_offset` is complicated to follow and difficult to extend to non-structs.
This changes the implementation, without actually changing any codegen (thus no test changes either), to be more like the existing `extract_field` (<https://github.com/rust-lang/rust/blob/2b0274c71dba0e24370ebf65593da450e2e91868/compiler/rustc_codegen_ssa/src/mir/operand.rs#L345-L425>) in that it allows setting a particular field directly.
Notably I've found this one much easier to get right, in particular because having the `OperandRef<Result<V, Scalar>>` gives a really useful thing to include in ICE messages if something did happen to go wrong.
|
|
|
|
|
|
|
|
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#141574 (impl `Default` for `array::IntoIter`)
- rust-lang/rust#141608 (Add support for repetition to `proc_macro::quote`)
- rust-lang/rust#142100 (rustdoc: make srcIndex no longer a global variable)
- rust-lang/rust#142371 (avoid `&mut P<T>` in `visit_expr` etc methods)
- rust-lang/rust#142517 (Windows: Use anonymous pipes in Command)
- rust-lang/rust#142520 (alloc: less static mut + some cleanup)
- rust-lang/rust#142588 (Generic ctx imprv)
- rust-lang/rust#142605 (Don't unwrap in enzyme builds in case of missing llvm-config)
- rust-lang/rust#142608 (Refresh module-level docs for `rustc_target::spec`)
- rust-lang/rust#142618 (Lint about `console` calls in rustdoc JS)
- rust-lang/rust#142620 (Remove a panicking branch in `BorrowedCursor::advance`)
- rust-lang/rust#142631 (Dont suggest remove semi inside macro expansion for redundant semi lint)
- rust-lang/rust#142632 (Update cargo)
- rust-lang/rust#142635 (Temporarily add back -Zwasm-c-abi=spec)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
This recently spuriously failed in a rollup, so I think we can afford to
increase the base timeout and the amount of time slept for to provide
a much wider margin for the timeout to be reached.
|
|
|
|
|
|
|
|
|
|
|
|
Temporarily add back -Zwasm-c-abi=spec
This allows a more gradual transition path for projects that need to use use the spec-complaint C ABI both with older and newer rustc versions.
|
|
Update cargo
6 commits in fc1518ef02b77327d70d4026b95ea719dd9b8c51..2251525ae503fa196f6d7f9ce6d32eccb2d5f044
2025-06-06 04:49:44 +0000 to 2025-06-16 22:01:27 +0000
- feat: Add custom completer for `cargo remove <TAB>` (rust-lang/cargo#15662)
- chore(deps): update msrv (3 versions) to v1.85 (rust-lang/cargo#15668)
- refactor: replace InternedString with Cow in IndexPackage (rust-lang/cargo#15559)
- highlight the correct words (rust-lang/cargo#15659)
- CHANGELOG.md: typo (rust-lang/cargo#15660)
- Use `Not::not` rather than a custom `is_false` function (rust-lang/cargo#15645)
|
|
Dont suggest remove semi inside macro expansion for redundant semi lint
Fixes rust-lang/rust#142143
r? compiler
|
|
Remove a panicking branch in `BorrowedCursor::advance`
|
|
Lint about `console` calls in rustdoc JS
As discussed [here](https://github.com/rust-lang/rust/pull/142100#discussion_r2151764395), this PR enforces that `console` is not used in rustdoc JS by default.
cc `@lolbinarycat`
|
|
workingjubilee:redescribe-rustc_target-more-accurately, r=wesleywiser
Refresh module-level docs for `rustc_target::spec`
We have long since gone on a curveball from the flexible-target-specification RFC by introducing stability and soundness promises to the language and compiler which we often struggle with extending to target-specific implementation details. Indeed, we often *literally cannot*. We also have modified the search algorithm details. Update the comments for `rustc_target::spec` considerably.
|
|
Don't unwrap in enzyme builds in case of missing llvm-config
r? `@onur-ozkan`
For some reason x.py was now panicking in this location, so I also removed the unwrap here.
part 2 of https://github.com/rust-lang/rust/pull/140000, there shouldn't be other locations where we check for llvm-config.
|
|
Generic ctx imprv
Cleanup work for my gpu pr
r? `@oli-obk`
|
|
alloc: less static mut + some cleanup
I'm looking into https://github.com/rust-lang/rust/issues/125035 and would like some feedback on my approach.
|
|
avoid `&mut P<T>` in `visit_expr` etc methods
trying a different way than rust-lang/rust#141636
r? ghost
|
|
Windows: Use anonymous pipes in Command
When setting `Stdio::pipe` on `Command` we want to create an anonymous pipe that can be used asynchronously (at least on our end). Usually we'd use [`CreatePipe`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe) to open anonymous pipes but unfortunately it opens pipes for synchronous access. The alternative is to use [`CreateNamedPipeW`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createnamedpipew) which does allow asynchronous access but that requires giving a file name to the pipe. So we currently have this awful hack where we attempt to emulate anonymous pipes using `CreateNamedPipeW` by attempting to create a unique name and looping until we find one that doesn't already exist.
The better option is to use the lower level [`NtCreateNamedPipeFile`](https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file) (which is used internally by both `CreatePipe` and `CreateNamedPipeW`). This function wasn't documented until a few years ago but now that it is it's ok for us to use it.
try-job: *msvc*
try-job: *mingw*
|
|
avoid `&mut P<T>` in `visit_expr` etc methods
trying a different way than rust-lang/rust#141636
r? ghost
|
|
rustdoc: make srcIndex no longer a global variable
this is one-time initialization data, it can just
be a function parameter.
while we're doing that, we can more the json parsing into the function and save a few extra bytes of storage for free, at least in the case of multiple crates in a doc bundle.
fixes https://github.com/rust-lang/rust/issues/138467
|
|
Add support for repetition to `proc_macro::quote`
Progress toward: rust-lang/rust#140238
|
|
|
|
|
|
impl `Default` for `array::IntoIter`
cc rust-lang/rust#91583
my personal use of this feature comes from https://github.com/fee1-dead/w/blob/092db5df631ea515b688bae99c7f02eef12d7221/src/cont.rs#L154-L170
insta-stable, but I feel like this is small enough to _not_ require an ACP (but a FCP per https://forge.rust-lang.org/libs/maintaining-std.html#when-theres-new-trait-impls)? feel free to correct me if I am wrong.
|
|
|
|
|
|
|
|
|
|
Subtree update of `rust-analyzer`
r? `@ghost`
|
|
|
|
|
|
|
|
_mm_alignr_epi8 in ssse3.rs, also removed the import of the unreachable unchecked hint as it was no longer necessary
|
|
a bug in the process.
|
|
|