Commit Graph

230315 Commits

Author SHA1 Message Date
David Wood
516a56581e
clippy: env! invocations can't be b"" literals
Signed-off-by: David Wood <david@davidtw.co>
2023-07-25 11:56:54 +01:00
David Wood
75df62d4a2
builtin_macros: raw str in diagnostic output
If a raw string was used in the `env!` invocation, then it should also
be shown in the diagnostic messages as a raw string.

Signed-off-by: David Wood <david@davidtw.co>
2023-07-25 11:12:52 +01:00
David Wood
c06a7eb2a6
builtin_macros: expect raw strings too
`expr_to_string` allows raw strings through so this code should be
expected to handle those.

Signed-off-by: David Wood <david@davidtw.co>
2023-07-24 15:06:50 +01:00
bors
ced592a99b Auto merge of #114003 - lnicola:sync-from-ra, r=lnicola
⬆️ `rust-analyzer`

r? `@ghost`
2023-07-24 09:38:23 +00:00
Laurențiu Nicola
6a944187fb Merge commit '99718d0c8bc5aadd993acdcabc1778fc7b5cc572' into sync-from-ra 2023-07-24 12:21:34 +03:00
bors
155a5c2862 Auto merge of #113978 - matthiaskrgr:clippy_072023_style, r=fee1-dead
couple of clippy::style changes

    comparison_to_empty
    iter_nth_zero
    for_kv_map
    manual_next_back
    redundant_pattern

    get_first
    single_char_add_str
    unnecessary_mut_passed
    manual_map
    manual_is_ascii_check
2023-07-24 07:48:04 +00:00
bors
bccefd2807 Auto merge of #113940 - inferiorhumanorgans:installer-no-hardcode-bash-path, r=ozkanonur
rust-installer: Use env(1) in the shebang.

This fixes the case (e.g. *BSD) where bash is installed on the host system, but not at the typical location of /bin.
2023-07-24 05:57:48 +00:00
Matthias Krüger
af2b370100 more clippy::style fixes:
get_first
single_char_add_str
unnecessary_mut_passed
manual_map
manual_is_ascii_check
2023-07-23 23:39:04 +02:00
Matthias Krüger
ed4c5fef72 fix some clippy::style findings
comparison_to_empty
iter_nth_zero
for_kv_map
manual_next_back
redundant_pattern
2023-07-23 23:36:56 +02: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
bors
99718d0c8b Auto merge of #15303 - oxalica:fix/byte-escape-highlight, r=lowr
Fix highlighting of byte escape sequences

Currently non-UTF8 escape sequences in byte strings and any escape sequences in byte literals are ignored.
2023-07-22 20:25:40 +00:00
oxalica
51b35ccb1b
Add comments for why skip highlighting for invalid char/byte literals 2023-07-23 04:24:35 +08: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
bors
c99bb3c782 Auto merge of #15281 - tetsuharuohzeki:split-ci-steps, r=lnicola
editor/code: Break down CI steps to know what is failing easily

This do the thing I mentioned in https://github.com/rust-lang/rust-analyzer/pull/15265#issuecomment-1634424385

This aims to improve CI status check more readable.

I tried to use [`jobs.<job_id>.if`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif) to make the configuration
more shortly once.

But it could not fire the `end-success` or `end-failure` status if some jobs in the workflow were skipped. This causes an integration problem with bors.

By their reasons, this patch still uses `jobs.<job_id>.steps[*].if`.

---

To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
2023-07-22 16:53:21 +00:00
Tetsuharu Ohzeki
5cca093fa8 editor/code: Break down CI steps to know what is failing easily
To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically
because ESLint's autofix doees not follow prettier's formatting.
So we need to run `npm run lint:fix && npm run format` by this order.
2023-07-23 01:51:57 +09: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
bors
b17be2720a Auto merge of #15277 - 1Kinoti:pub-assist, r=lowr
limit `change_visibility` assist to applicable items

this pr limits the `change_visibility` assist to applicable items. top level items in this context means items that are not nested within `fn`s or `trait`s.

now
```rs
fn foo {
    // assists on this `struct` keyword won't include `change_visibility`
    struct Bar {}
}

trait Foo {
   // same with the `fn` here
   fn bar();
}
```
2023-07-22 15:02:15 +00:00
1Kinoti
65823b0c74 limit change_visibility assist to applicable items 2023-07-22 17:16:51 +03: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