Commit Graph

230278 Commits

Author SHA1 Message Date
Nicholas Nethercote
d2f7f67921 Avoid some token tree cloning in decl macro parsing.
By changing `into_trees` into `trees`. Some of the subsequent paths
require explicit clones, but not all.
2023-07-27 11:58:42 +10:00
Nicholas Nethercote
853f453d57 Avoid some token cloning in filter_tokens_from_list.
Now the cloning only happens on some paths, instead of all paths.
2023-07-27 11:58:42 +10:00
Nicholas Nethercote
55a732461d Make TokenTree::uninterpolate take &self and return a Cow.
Making it similar to `Token::uninterpolate`. This avoids some more token
tree cloning.
2023-07-27 11:58:42 +10:00
Nicholas Nethercote
103bd4a820 Use TokenStream::trees instead of into_trees for attributes.
This avoids cloning some token trees. A couple of `clone` calls were
inserted, but only on some paths, and the next commit will remove them.
2023-07-27 11:58:42 +10:00
Nicholas Nethercote
a9d8459299 Replace into_trees with trees in a test.
There's no need for token tree cloning here.
2023-07-27 10:40:39 +10:00
Nicholas Nethercote
53379a7b65 Simplify the ttdelim_span test.
The existing code is a very complex and inefficient way to the get the
span of the last token.
2023-07-27 09:41:49 +10:00
bors
8771282d4e Auto merge of #113976 - GuillaumeGomez:migrate-gui-test-color-23, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-07-23 17:46:36 +00:00
bors
d9d80e211e Auto merge of #113965 - chenyukang:yukang-fix-113963-panic, r=ozkanonur
Fix test panics for submodule of book is not updated

Fixes #113963
2023-07-23 15:57:50 +00:00
bors
c474aa7db0 Auto merge of #113975 - matthiaskrgr:clippy_07_2023, r=fee1-dead
clippy::style fixes

r? `@oli-obk`

filter_map_identity
iter_kv_map
needless_question_mark
redundant_at_rest_pattern
filter_next
derivable_impls
useless_format
2023-07-23 14:09:19 +00:00
bors
d4fe4c8b95 Auto merge of #113973 - matthiaskrgr:charstr, r=cjgillot
match on chars instead of &strs for .split() or .strip_prefix()
2023-07-23 12:21:42 +00:00
Guillaume Gomez
e06633fde6 Migrate GUI colors test to original CSS color format 2023-07-23 13:05:40 +02:00
bors
699f4a637e Auto merge of #113972 - matthiaskrgr:clones_123, r=cjgillot
remove redundant clones
2023-07-23 10:36:17 +00:00
Matthias Krüger
b594798ae3 fix clippy::useless_format 2023-07-23 11:14:52 +02:00
Matthias Krüger
adf759bf6a fix couple of clippy findings:
filter_map_identity
iter_kv_map
needless_question_mark
redundant_at_rest_pattern
filter_next
derivable_impls
2023-07-23 10:50:14 +02:00
bors
2a4a8c8106 Auto merge of #113974 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-07-23 08:47:28 +00:00
Matthias Krüger
7a7708904b match on chars instead of &strs for .split() or .strip_prefix() 2023-07-23 10:13:41 +02:00
Matthias Krüger
abde841f0a remove redundant clones 2023-07-23 09:48:07 +02:00
bors
0c9d1a353e Auto merge of #2990 - RalfJung:rustup, r=RalfJung
Rustup
2023-07-23 07:28:47 +00:00
Ralf Jung
8a3b7463ed Merge from rustc 2023-07-23 09:27:28 +02:00
Ralf Jung
46ddf460af Preparing for merge from rustc 2023-07-23 09:25:15 +02:00
bors
cec34a43b1 Auto merge of #113961 - fmease:fewer-features_untracked, r=compiler-errors
Use `features()` over `features_untracked()` where possible

`Resolver` has a `TyCtxt` nowadays.

`@rustbot` label C-cleanup
2023-07-23 02:03:21 +00:00
bors
1c44af9b79 Auto merge of #111836 - calebzulawski:target-feature-closure, r=workingjubilee
Fix #[inline(always)] on closures with target feature 1.1

Fixes #108655.  I think this is the most obvious solution that isn't overly complicated.  The comment includes more justification, but I think this is likely better than demoting the `#[inline(always)]` to `#[inline]`, since existing code is unaffected.
2023-07-23 00:16:03 +00:00
bors
98179ad634 Auto merge of #113943 - ericmarkmartin:smir-ty-alias, r=spastorino
Add Alias to smir

r? Spastorino
2023-07-22 22:20:54 +00:00
bors
1d56e3a6d9 Auto merge of #112953 - compiler-errors:interpolated-block-exprs, r=WaffleLapkin
Support interpolated block for `try` and `async`

I'm putting this up for T-lang discussion, to decide whether or not they feel like this should be supported. This was raised in #112952, which surprised me. There doesn't seem to be a *technical* reason why we don't support this.

### Precedent:

This is supported:

```rust
macro_rules! always {
  ($block:block) => {
    if true $block
  }
}

fn main() {
    always!({});
}
```

### Counterpoint:

However, for context, this is *not* supported:

```rust
macro_rules! unsafe_block {
  ($block:block) => {
    unsafe $block
  }
}

fn main() {
    unsafe_block!({});
}
```

If this support for `async` and `try` with interpolated blocks is *not* desirable, then I can convert them to instead the same diagnostic as `unsafe $block` and make this situation a lot less ambiguous.

----

I'll try to write up more before T-lang triage on Tuesday. I couldn't find anything other than #69760 for why something like `unsafe $block` is not supported, and even that PR doesn't have much information.

Fixes #112952
2023-07-22 20:37:44 +00:00
Eric Mark Martin
7ac0ef9d11 add docs for AliasKind::Inherent 2023-07-22 15:38:41 -04:00
Eric Mark Martin
aa33e8945c add Alias for smir 2023-07-22 15:38:41 -04:00
bors
a6fbd1c58d Auto merge of #113968 - matthiaskrgr:rollup-7vdfcba, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #112508 (Tweak spans for self arg, fix borrow suggestion for signature mismatch)
 - #113901 (Get rid of subst-relate incompleteness in new solver)
 - #113948 (Fix rustc-args passing issue in bootstrap)
 - #113950 (Remove Scope::Elision from bound-vars resolution.)
 - #113957 (Add regression test for issue #113941 - naive layout isn't refined)
 - #113959 (Migrate GUI colors test to original CSS color format)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-22 18:49:42 +00:00
León Orell Valerian Liehr
2a75a0f724
Use features() over features_untracked() where possible 2023-07-22 20:09:40 +02:00
Matthias Krüger
52153432a8
Rollup merge of #113959 - GuillaumeGomez:migrate-gui-test-color-22, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-07-22 19:57:38 +02:00
Matthias Krüger
b7183bd167
Rollup merge of #113957 - Urgau:regression-test-issue-113941, r=dtolnay
Add regression test for issue #113941 - naive layout isn't refined

This PR adds a regression test for issue #113941 - `the naive layout isn't refined by the actual layout` based on the minimized repro https://github.com/rust-lang/rust/issues/113941#issuecomment-1646446769.
2023-07-22 19:57:37 +02:00
Matthias Krüger
00e147543c
Rollup merge of #113950 - cjgillot:clean-resolve, r=jackh726
Remove Scope::Elision from bound-vars resolution.

This scope is a remnant of HIR-based lifetime resolution.

It's only role was to ensure that object lifetime resolution falled back to `'static`. This can be done using `ObjectLifetimeDefault` scope.
2023-07-22 19:57:37 +02:00
Matthias Krüger
3c83eabdb4
Rollup merge of #113948 - chenyukang:yukang-fix-113178-bootstrap, r=clubby789
Fix rustc-args passing issue in bootstrap

Fixes #113178, r? `@jyn514`
2023-07-22 19:57:36 +02:00
Matthias Krüger
8f4b81b146
Rollup merge of #113901 - compiler-errors:only-bidi-norm, r=lcnr
Get rid of subst-relate incompleteness in new solver

We shouldn't need subst-relate if we have bidirectional-normalizes-to in the new solver.

The only potential issue may happen if we have an unconstrained projection like `<Wrapper<?0> as Trait>::Assoc == <Wrapper<T> as Trait>::Assoc` where they both normalize to something that doesn't mention any substs, which would possibly prefer `?0 = T` if we fall back to subst-relate. But I'd prefer if we remove incompleteness until we can determine some case where we need them, and the bidirectional-normalizes-to seems better to have in general.

I can update https://github.com/rust-lang/trait-system-refactor-initiative/issues/26 and https://github.com/rust-lang/trait-system-refactor-initiative/issues/25 once this lands.

r? `@lcnr`
2023-07-22 19:57:36 +02:00
Matthias Krüger
0ed5f091a6
Rollup merge of #112508 - compiler-errors:trait-sig-lifetime-sugg-ice, r=cjgillot
Tweak spans for self arg, fix borrow suggestion for signature mismatch

1. Adjust a suggestion message that was annoying me
2. Fix #112503 by recording the right spans for the `self` part of the `&self` 0th argument
3. Remove the suggestion for adjusting a trait signature on type mismatch, bc that's gonna probably break all the other impls of the trait even if it fixes its one usage 😅
2023-07-22 19:57:35 +02:00
bors
c39995485f Auto merge of #113853 - cjgillot:split-validator, r=compiler-errors
Reuse the MIR validator for MIR inlining

Instead of having the inliner home-cook its own validation, we just check that the substituted MIR body passes the regular validation.

The MIR validation is first split in two: control flow validation (MIR syntax and CFG invariants) and type validation (subtyping relationship in assignments and projections). Only the latter can be affected by instantiating type parameters.
2023-07-22 16:59:23 +00:00
yukang
d46804c62a Fix test panics for submodule of book is not updated 2023-07-23 00:53:39 +08:00
Michael Goulet
e32011209d Get rid of subst-relate incompleteness in new solver 2023-07-22 15:33:37 +00:00
Michael Goulet
7b962d7543 Support interpolated block for try and async 2023-07-22 15:22:12 +00:00
bors
ab0f3e680e Auto merge of #113960 - bjorn3:sync_cg_clif-2023-07-22, r=bjorn3
Sync rustc_codegen_cranelift

This time Cranelift has been updated to 0.98. A couple of bugs have been fixed and a decent amount of x86 vendor intrinsics have been implemented.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-07-22 15:09:09 +00:00
bjorn3
8ffa34ad4e Fix tidy error 2023-07-22 13:47:39 +00:00
bjorn3
36708123c1 Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into sync_cg_clif-2023-07-22 2023-07-22 13:32:34 +00:00
bors
8164cdb9ee Auto merge of #113746 - clarfonthey:ip_bits, r=thomcc
Add BITS, from_bits, to_bits to IP addresses

ACP: rust-lang/libs-team#235
Tracking issue: #113744
2023-07-22 13:18:50 +00:00
Guillaume Gomez
d4ce83c385 Migrate GUI colors test to original CSS color format 2023-07-22 14:01:23 +02:00
bjorn3
1eded3619d Update to Cranelift 0.98 2023-07-22 11:32:25 +00:00
bors
42f5419dd2 Auto merge of #113954 - matthiaskrgr:rollup-e2r9suz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #112490 (Remove `#[cfg(all())]` workarounds from `c_char`)
 - #113252 (Update the tracking issue for `const_cstr_from_ptr`)
 - #113442 (Allow limited access to `OsString` bytes)
 - #113876 (fix docs & example for `std::os::unix::prelude::FileExt::write_at`)
 - #113898 (Fix size_hint for EncodeUtf16)
 - #113934 (Multibyte character removal in String::pop and String::remove doctests)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-22 11:30:18 +00:00
bjorn3
ebe2825966 Fix rustc test suite 2023-07-22 11:27:49 +00:00
bjorn3
4eabaf331f Rustup to rustc 1.73.0-nightly (0308df23e 2023-07-21) 2023-07-22 11:11:45 +00:00
Urgau
ffa4b6f422 Add regression test for issue #113941 - naive layout isn't refined 2023-07-22 13:02:59 +02:00
bjorn3
a8a722f211 Sync from rust 0308df23e6 2023-07-22 10:54:06 +00:00
Matthias Krüger
37cd63431c
Rollup merge of #113934 - ajtribick:string-pop-remove-multibyte, r=thomcc
Multibyte character removal in String::pop and String::remove doctests

I think it would be useful to have the doctests for the `String::pop()` and `String::remove()` methods demonstrate that they work on multibyte UTF-8 sequences.
2023-07-22 11:48:55 +02:00