Commit graph

253170 commits

Author SHA1 Message Date
DianQK b52be28fda
Disable SimplifyToExp in MatchBranchSimplification 2024-04-20 05:37:53 +08:00
Matthias Krüger b015f61488 add more known-crashes tests 2024-04-19 23:09:37 +02:00
Matthias Krüger e0586a6e1a add test for #83993
Fixes #83993
2024-04-19 23:09:37 +02:00
Weihang Lo db881f67f3
Update cargo 2024-04-19 17:04:13 -04:00
bors c83d8cf584 Auto merge of #17110 - Veykril:cargo-script-mvp, r=Veykril
Cargo script mvp

Based on https://github.com/rust-lang/rust-analyzer/pull/15456,

As the original PR stated, detached files are still horrendous to work with.
2024-04-19 20:51:10 +00:00
bors e9ebc6f800 Auto merge of #3475 - RalfJung:reduce-reuse-recycle, r=RalfJung
Address reuse improvements and fixes

- when an address gets reused, establish a happens-before link in the data race model
- do not reuse stack addresses, and make the reuse rate configurable

Fixes https://github.com/rust-lang/miri/issues/3450
2024-04-19 20:50:04 +00:00
Trevor Gross 282488c808 Match hyphen in multi-revision comment matchers
Currently, the matcher `//[rev-foo,rev-bar]~` does not get selected by
the regex. Change the matcher to also match strings that contain a `-`.h
2024-04-19 16:03:44 -04:00
bors f9b1614920 Auto merge of #124170 - matthiaskrgr:rollup-ldopl64, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #123571 (Correctly change type when adding adjustments on top of `NeverToAny`)
 - #123729 (run-make: refactor out command wrappers for `clang` and `llvm-readobj`)
 - #124106 (Don't repeatedly duplicate TAIT lifetimes for each subsequently nested TAIT)
 - #124149 (rustdoc-search: fix description on aliases in results)
 - #124155 (bootstrap: don't use rayon for sysinfo)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-19 19:18:56 +00:00
bors 8621e79fa7 Auto merge of #17104 - hamirmahal:fix/usage-of-deprecated-version-of-node-in-metrics-yml, r=lnicola
fix: usage of `deprecated` version of `Node.js`

fixes #17103.
2024-04-19 18:36:33 +00:00
Hamir Mahal 3d6bd24dcb
fix: usage of deprecated version of Node.js 2024-04-19 11:18:25 -07:00
Michael Goulet 5daf58ffc1 Fix capturing duplicated lifetimes via parent 2024-04-19 14:12:21 -04:00
Matthias Krüger f1e536df59
Rollup merge of #124155 - klensy:wrong-rayon-here, r=albertlarsan68
bootstrap: don't use rayon for sysinfo

It's looks overkill to use rayon to collect cpu usage
2024-04-19 19:30:50 +02:00
Matthias Krüger f8afb6314b
Rollup merge of #124149 - notriddle:notriddle/desc-alias, r=GuillaumeGomez
rustdoc-search: fix description on aliases in results

This needs to start downloading the descriptions after aliases have been added to the result set.
2024-04-19 19:30:49 +02:00
Matthias Krüger 26d4b1bfba
Rollup merge of #124106 - compiler-errors:tait-lifetime-dedup, r=oli-obk
Don't repeatedly duplicate TAIT lifetimes for each subsequently nested TAIT

Make it so that nested TAITs inherit the lifetimes from their parent item, not their parent TAIT. This is because we don't need to re-duplicate lifetimes for nested TAITs over and over, since the only lifetimes they can capture are from the parent item anyways.

This mirrors how RPITs work. This is **not** a functional change that should be observable, since the whole point of duplicating lifetimes and marking the shadowed ones (and uncaptured ones) as bivariant is designed to *not* be observable.

r? oli-obk
2024-04-19 19:30:49 +02:00
Matthias Krüger b1eee427a0
Rollup merge of #123729 - jieyouxu:rmake-refactor-2, r=oli-obk
run-make: refactor out command wrappers for `clang` and `llvm-readobj`

This PR is rebased on top of https://github.com/rust-lang/rust/pull/123699.

This PR is a follow up to https://github.com/rust-lang/rust/pull/123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`.

r? ghost
2024-04-19 19:30:48 +02:00
Matthias Krüger 6c4657c086
Rollup merge of #123571 - WaffleLapkin:properly-adjust-never, r=compiler-errors
Correctly change type when adding adjustments on top of `NeverToAny`

I'm concerned that the check only caught the problem with `fallback = !`, because at least MIR contained `<() as PartialEq>::eq(move _5, move _7)` where `_5: ()`.

I rediscovered the issue when looking at #123482's crater run.

r? compiler-errors
Fixes #120600
2024-04-19 19:30:48 +02:00
bors ce3263e60e Auto merge of #124113 - RalfJung:interpret-scalar-ops, r=oli-obk
interpret: use ScalarInt for bin-ops; avoid PartialOrd for ScalarInt

Best reviewed commit-by-commit

r? `@oli-obk`
2024-04-19 17:00:28 +00:00
zhuyunxing 402dc38d99 coverage. Add basic tests for MC/DC 2024-04-20 00:34:40 +08:00
zhuyunxing 439dbfa1ec coverage. Lowering MC/DC statements to llvm-ir 2024-04-20 00:34:40 +08:00
Lukas Wirth 0ce7179e6b Correctly populate detached files roots 2024-04-19 18:25:10 +02:00
Lukas Wirth 46f05543a2 Patch cargo script root files back to manifest 2024-04-19 18:25:10 +02:00
Lukas Wirth 0b24599cf9 Re-implement dependecny tracking for cargo script 2024-04-19 18:25:06 +02:00
hkalbasi 2f828073aa Add minimal support for cargo scripts 2024-04-19 18:23:06 +02:00
Oli Scherer dadece067e Let inherent associated types constrain opaque types during projection 2024-04-19 16:12:54 +00:00
bors 50bdeaad07 Auto merge of #17108 - Veykril:rustc-ws-hacks, r=Veykril
internal: Cleanup cfg and env handling in project-model

Fixes https://github.com/rust-lang/rust-analyzer/issues/16122#issuecomment-2065794340

`miri` and `debug_assertions` are now enabled via the `cargo.cfgs` config by default, allowing them to be disabled by overwriting the config.
2024-04-19 16:00:54 +00:00
Ralf Jung d3f927db87 avoid PartialOrd on ScalarInt
we don't know their sign so we cannot, in general, order them properly
2024-04-19 17:17:31 +02:00
bors d1a0fa5ed3 Auto merge of #118441 - GuillaumeGomez:display-stability-version, r=rustdoc
Always display stability version even if it's the same as the containing item

Fixes https://github.com/rust-lang/rust/issues/118439.

Currently, if the containing item's version is the same as the item's version (like a method), we don't display it on the item.

This was something done on purpose as you can see [here](e9b7bf0114/src/librustdoc/html/render/mod.rs (L949-L955)). It was implemented in https://github.com/rust-lang/rust/pull/30686.

I think we should change this because on pages with a lot of items, if someone arrives (through the search or a link) to an item far below the page, they won't know the stability version unless they scroll to the top, which isn't great.

You can see the result [here](https://rustdoc.crud.net/imperio/display-stability-version/std/pin/struct.Pin.html#method.new).

r? `@notriddle`
2024-04-19 14:17:29 +00:00
bors 05428c5640 Auto merge of #17024 - roife:fix-issue-16980, r=Veykril
fix: handle escaped chars in doc comments

fix #16980.

For `ast::LiteralKind::String`, store the original string value.
2024-04-19 13:19:22 +00:00
roife 3e232bb78a fix: replace unescape fn with the one in ra-ap-rustc_lexer 2024-04-19 20:32:53 +08:00
bors 07d0d7ce3f Auto merge of #123364 - klensy:bs-mixed-types, r=albertlarsan68
bootstrap: actually allow set debuginfo-level to "line-tables-only"

I've tried to set in config.toml `rust.debuginfo-level = "line-tables-only"`, but ended with:
``` failed to parse TOML configuration 'config.toml':
data did not match any variant of untagged enum StringOrInt for key `rust.debuginfo-level`
```
Also this PR allows to set `line-directives-only` for debuginfo in config.toml too.
1. Fixes this. Alternative is remove that Deserialize and use default one:
0e682e9875/src/bootstrap/src/core/config/config.rs (L725-L728)

2. Should `line-directives-only` be added too?

3. I've tried to add test to rust/src/bootstrap/src/core/config/tests.rs:
```rust
#[test]
fn rust_debuginfo() {
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = 1").rust_debuginfo_level_rustc,
        DebuginfoLevel::Limited
    ));
    assert!(matches!(
        parse("rust.debuginfo-level-rustc = \"line-tables-only\"").rust_debuginfo_level_rustc,
        DebuginfoLevel::LineTablesOnly
    ));
}
```

But test passes before that PR too; looks like config parse tests checks something wrong? I mean, that tests check something which isn't actual bootstrap behavior.
2024-04-19 12:11:09 +00:00
Ralf Jung 42220f0930 ScalarInt: add methods to assert being a (u)int of given size 2024-04-19 13:51:52 +02:00
Maybe Waffle e5a6d8d0cd Remove old ICE tests that no longer ICE (yay!) 2024-04-19 11:34:37 +00:00
Lukas Wirth cdb8c3a327 Fix tests being non-deterministic 2024-04-19 13:22:00 +02:00
Maybe Waffle 0bbe362901 Correctly change type when adding adjustments on top of NeverToAny 2024-04-19 11:05:02 +00:00
Maybe Waffle 4d749cad25 Add a test for a == b where a: !, b: !
(this currently produces malformed mir: we call `eq` with first argument not
being a reference)
2024-04-19 11:05:02 +00:00
Maybe Waffle 662d276573 Add regression test for issue 120600 2024-04-19 11:05:02 +00:00
bors 43a0686f8d Auto merge of #115253 - donno2048:patch-1, r=albertlarsan68
Implement `PROBLEMATIC_CONSTS` generalization

You forgot that `A≈4`, `B≈8`, and `E≈3` and some more constants.

The new `PROBLEMATIC_CONSTS` was generated using this code:

```py
from functools import reduce
def generate_problems(consts: list, letter_digit: dict):
    for const in consts:
        problem = reduce(lambda string, rep: string.replace(*reversed(rep)), ['%X' % const, *letter_digit.items()])
        indexes = [index for index, c in enumerate(problem) if c in letter_digit.keys()]
        for i in range(1 << len(indexes)):
            yield int(''.join(letter_digit[c] if index in indexes and (i >> indexes.index(index)) & 1 else c for index, c in enumerate(problem)), 0x10)

problems = generate_problems(
    [
        # Old PROBLEMATIC_CONSTS:
        184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037,
        3735927486, 3735932941, 4027431614, 4276992702,
        # More of my own:
        195934910, 252707358, 762133, 179681982, 173390526
    ],
    {
    'A': '4',
    'B': '8',
    'E': '3',
    }
)

# print(list(problems)) # won't use that to print formatted

from itertools import islice
while len(cur_problems := list(islice(problems, 8))):
    print('    ', end='')
    print(*cur_problems, sep=', ', end='')
    print(',')
```
2024-04-19 09:52:17 +00:00
bors 77ce295006 Auto merge of #17094 - Lindronics:convert-from-to-tryfrom, r=Veykril
feat: Add convert From to TryFrom assist

Adds a new code assist to convert a `From` impl into a `TryFrom` impl.

This is useful in situations where it turns out after or halfway through writing a `From` implementation that the conversion is actually fallible.

## Example

https://github.com/rust-lang/rust-analyzer/assets/26360861/872ec7c4-c9ff-451c-9453-4baaaad47326
2024-04-19 09:15:20 +00:00
zhuyunxing cf6b6cb2b4 coverage. Generate Mappings of decisions and conditions for MC/DC 2024-04-19 17:09:26 +08:00
klensy 6612ad796c bootstrap: don't use rayon for sysinfo
It's looks overkill to use rayon to collect cpu usage
2024-04-19 12:07:07 +03:00
Lukas Wirth 0485a85ee2 Set debug_assertions and miri cfgs as config defaults, allowing them to be overwritten 2024-04-19 11:06:55 +02:00
bors 95ae2dd7ff Auto merge of #3489 - rust-lang:rustup-2024-04-19, r=RalfJung
Automatic Rustup
2024-04-19 09:00:46 +00:00
Lukas Wirth 8989dcffd6 Support cfg overrides in all workspace kind 2024-04-19 10:59:32 +02:00
Ralf Jung fecd7fc937 make test not leak rustc crate hash 2024-04-19 10:59:27 +02:00
Lukas Wirth ee10f9f5cd Cleanup cfg and env handling in project-model 2024-04-19 10:41:08 +02:00
bors 134ee309c9 Auto merge of #3490 - RalfJung:paths, r=RalfJung
share code between win-to-unix and unix-to-win path conversion
2024-04-19 07:58:10 +00:00
bors c4f112af6e Auto merge of #124123 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-04-19 07:39:44 +00:00
Niklas Lindorfer 1aba0002df
Add convert From to TryFrom assist 2024-04-19 08:29:20 +01:00
bors eea61bd4d1 Auto merge of #16726 - Veykril:rustc-ws-hacks, r=Veykril
internal: Remove rustc core test cfg hacks

cc https://github.com/rust-lang/rust-analyzer/issues/16538
2024-04-19 07:28:50 +00:00
Lukas Wirth 2e54c0af40 Remove rustc core test cfg hacks 2024-04-19 09:27:05 +02:00