| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix #58856.
|
|
|
|
|
|
There is no longer a need to append the string `", ..."` to a functions
args as `...` is parsed as an argument and will appear in the functions
arguments.
|
|
Fix #58857.
|
|
Support defining C compatible variadic functions
## Summary
Add support for defining C compatible variadic functions in unsafe rust with
`extern "C"` according to [RFC 2137].
## Details
### Parsing
When parsing a user defined function that is `unsafe` and `extern "C"` allow
variadic signatures and inject a "spoofed" `VaList` in the new functions
signature. This allows the user to interact with the variadic arguments via a
`VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for
details).
### Codegen
When running codegen for a variadic function, remove the "spoofed" `VaList`
from the function signature and inject `va_start` when the arg local
references are created for the function and `va_end` on return.
## TODO
- [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen
- [x] Properly inject `va_end` - It seems like it should be possible to inject
`va_end` on the `TerminatorKind::Return`. I just need to figure out how
to get the `LocalRef` here.
- [x] Properly call Rust defined C variadic functions in Rust - The spoofed
`VaList` causes problems here.
Related to: #44930
r? @ghost
[RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
|
|
Function signatures with the `variadic` member set are actually
C-variadic functions. Make this a little more explicit by renaming the
`variadic` boolean value, `c_variadic`.
|
|
|
|
Add support for defining C compatible variadic functions in unsafe rust
with extern "C".
|
|
Add tracking issue for the unwind attribute
cc https://github.com/rust-lang/rust/issues/58760
|
|
update scoped_tls to 1.0
scoped_tls has been updated to version 1.0
This PR will hopefully merge flawlessly :)
This fixes, among others, https://github.com/alexcrichton/scoped-tls/issues/9
Note, that the nightly feature has been removed in https://github.com/alexcrichton/scoped-tls/commit/64bd7b84a1765fb72a32caed3c17c970bdc6ad57
|
|
Deny `async fn` in 2015 edition
This commit prevents code using `async fn` from being compiled in Rust 2015 edition.
Compiling code of the form:
```rust
async fn foo() {}
```
Will now result in the error:
```
error[E0670]: `async fn` is not permitted in the 2015 edition
--> async.rs:1:1
|
1 | async fn foo() {}
| ^^^^^
error: aborting due to error
For more information about an error, try `rustc --explain E0670`.
```
This resolves #58652 and also resolves #53714.
r? @varkor
|
|
Make `visit_clobber` panic-safe.
Local measurements indicate the performance effect is negligible.
r? @petrochenkov
|
|
Fix for issue #58050
Hi,
a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue #58050
It passed `python x.py test src/tools/tidy` locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.
Let me know if anything else is needed.
|
|
Simplify input validation for `#[unwind]`, add tests
|
|
|
|
Signed-off-by: Adonis <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Stabilize split_ascii_whitespace
Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750
fix stabilization order of uniform_paths.
hir: add HirId to main Hir nodes
Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`
Fixes https://github.com/fortanix/rust-sgx/issues/88
Update src/libsyntax/ext/tt/quoted.rs
Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Revert "Merge remote-tracking branch 'upstream/master'"
This reverts commit 751f05bd155e2c55d4177fe8211df634faf3a644, reversing
changes made to 545a3e62b0cb473108869a61b271bc589afb49da.
|
|
|
|
|
|
|
|
|
|
Fix style issues and update diagnostic messages
Update src/librustc_passes/diagnostics.rs
Co-Authored-By: doctorn <me@nathancorbyn.com>
Deny nested `async fn` in Rust 2015 edition
Deny nested `async fn` in Rust 2015 edition
Deny nested `async fn` in Rust 2015 edition
|
|
Implement unstable ffi_return_twice attribute
This PR implements [RFC2633](https://github.com/rust-lang/rfcs/pull/2633)
r? @eddyb
|
|
Improve parsing diagnostic for negative supertrait bounds
closes #33418
r? @estebank
|
|
|
|
|
|
Do not underflow after resetting unmatched braces count
Fix #58638.
r? @oli-obk
|
|
Special suggestion for illegal unicode curly quote pairs
Fixes #58436
Did not end up expanding the error message span to include the full string literal since I figured the start of the token was the issue, while the help suggestion span would include up to the closing quotation mark.
The look ahead logic does not affect the reader position, not sure if that is an issue (if eg it should still continue to parse after the closing quote without erroring out).
|
|
Remove `LazyTokenStream`.
`LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster.
r? @alexcrichton
|
|
|
|
Fix #58638.
|
|
cleanup macro after 2018 transition
We can now use `?`
|
|
remove a bit of dead code
[Six years](https://github.com/rust-lang/rust/commit/5dc5efefd47527067ab5b7862d89a99da4824f49) seem to be a long enough transition period :rofl:
|
|
igorsdv:suggest-removing-parentheses-surrounding-lifetimes, r=estebank
Suggest removing parentheses surrounding lifetimes
Fixes #57386.
r? @estebank
|
|
We can now use `?`
|
|
|
|
Fix style nits discovered in reading code.
|
|
|
|
The current code (expensively) clones the value within an `Rc`. This
commit changes things so that the `Rc` itself is (cheaply) cloned
instead, avoid some allocations.
This requires converting a few `Rc` instances to `Lrc`.
|
|
It's present within `Token::Interpolated` as an optimization, so that if
a nonterminal is converted to a `TokenStream` multiple times, the
first-computed value is saved and reused.
But in practice it's not needed. `interpolated_to_tokenstream()` is a
cold function: it's only called a few dozen times while compiling rustc
itself, and a few hundred times across the entire `rustc-perf` suite.
Furthermore, when it is called, it is almost always the first
conversion, so no benefit is gained from it.
So this commit removes `LazyTokenStream`, along with the now-unnecessary
`Token::interpolated()`.
As well as a significant simplification, the removal speeds things up
slightly, mostly due to not having to `drop` the `LazyTokenStream`
instances.
|
|
It is currently a method of `Token`, but it only is valid to call if
`self` is a `Token::Interpolated`. This commit eliminates the
possibility of misuse by changing it to an associated function that
takes a `Nonterminal`, which also simplifies the call sites.
This requires splitting out a new function, `nonterminal_to_string`.
|
|
quotes #58436
|
|
Stabilize slice_sort_by_cached_key
I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here. The method was added last March by https://github.com/rust-lang/rust/pull/48639.
Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
```rust
impl [T] {
pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord;
}
```
That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?".
The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key
(I'm asking because it's exactly what I just needed the other day:
```rust
all_positions.sort_by_cached_key(|&n|
data::CITIES.iter()
.map(|x| *metric_closure.get_edge(n, x.pos).unwrap())
.sum::<usize>()
);
```
since caching that key is a pretty obviously good idea.)
Closes #34447
|
|
|