Commit graph

169056 commits

Author SHA1 Message Date
Martin Kröning 21625e5730 Session object: Set OS/ABI
This adapts LLVM's behavior of MCELFObjectTargetWriter::getOSABI [1].

[1]: 8c8a2679a2/llvm/include/llvm/MC/MCELFObjectWriter.h (L72-L86)
2022-06-23 11:20:52 +02:00
Martin Kröning f7d12b4eec Session object: Decouple e_flags from FileFlags 2022-06-01 23:13:46 +02:00
bors 946a88a989 Auto merge of #97546 - RalfJung:miri, r=oli-obk
update Miri

First update with the new ui test suite, let's hope this all works. :)
r? `@oli-obk`

Fixes https://github.com/rust-lang/rust/issues/97486
2022-05-30 11:59:55 +00:00
Ralf Jung 962d54e5e8 be less redundant redundant 2022-05-30 12:35:01 +02:00
Oli Scherer 3c66939671
Let miri decide the flags to use for the test suite 2022-05-30 12:10:28 +02:00
bors 5c780b98d1 Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errors
Replace `#[default_method_body_is_const]` with `#[const_trait]`

pulled out of #96077

related issues:  #67792 and #92158

cc `@fee1-dead`

This is groundwork to only allowing `impl const Trait` for traits that are marked with `#[const_trait]`. This is necessary to prevent adding a new default method from becoming a breaking change (as it could be a non-const fn).
2022-05-30 09:19:03 +00:00
Oli Scherer 2f96fbe220 update diagnostic message on removed attribute
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
2022-05-30 08:52:25 +00:00
Oli Scherer 0e3d8d2b13 Default methods of traits are also AssocFn defs as they essentially desugar to a method in a new impl block 2022-05-30 08:52:25 +00:00
Oli Scherer ecaf7b7cee Reduce the scope of a mutable variable 2022-05-30 08:52:25 +00:00
Oli Scherer 4d390de4a3 Add a helper function for checking whether a default function in a trait can be treated as const 2022-05-30 08:52:25 +00:00
Deadbeef 257f06587c Remove #[default..] and add #[const_trait] 2022-05-30 08:52:24 +00:00
Ralf Jung a272c45678 update Miri 2022-05-30 10:17:46 +02:00
bors 855fc022fe Auto merge of #97489 - GuillaumeGomez:settings-js-disabled, r=notriddle
Add sentence in case JS is disabled on settings.html page

Instead of having an empty page, it'll look like this:

![Screenshot from 2022-05-28 17-46-23](https://user-images.githubusercontent.com/3050060/170833333-e1a59c2b-27ca-47da-9c08-2356e4a689cb.png)

r? `@notriddle`
2022-05-30 04:15:10 +00:00
bors 6999ef2564 Auto merge of #97538 - compiler-errors:rollup-zp3ukke, r=compiler-errors
Rollup of 4 pull requests

Successful merges:

 - #97493 (Use `type_is_copy_modulo_regions` check in intrisicck)
 - #97518 (Fix order of closing HTML elements in rustdoc output)
 - #97530 (Add more eslint checks)
 - #97536 (Remove unused lifetimes from expand_macro)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-29 23:25:51 +00:00
Michael Goulet f20bbc1fb0
Rollup merge of #97536 - est31:remove_unused_lifetimes, r=compiler-errors
Remove unused lifetimes from expand_macro

The function doesn't need the lifetimes
of the two arguments be bound together.
2022-05-29 16:25:05 -07:00
Michael Goulet 8e01595d9b
Rollup merge of #97530 - GuillaumeGomez:more-eslint-checks, r=jsha
Add more eslint checks

Here is a new batch of eslint checks:

 * [no-const-assign](https://eslint.org/docs/rules/no-const-assign)
 * [no-debugger](https://eslint.org/docs/rules/no-debugger)
 * [no-dupe-args](https://eslint.org/docs/rules/no-dupe-args)
 * [no-duple-else-if](https://eslint.org/docs/rules/no-dupe-else-if)
 * [no-dupe-keys](https://eslint.org/docs/rules/no-dupe-keys)
 * [no-duplicate-case](https://eslint.org/docs/rules/no-duplicate-case)
 * [no-ex-assign](https://eslint.org/docs/rules/no-ex-assign)

r? ``@notriddle``
2022-05-29 16:25:04 -07:00
Michael Goulet f68c532e6f
Rollup merge of #97518 - badboy:rustdoc-ul-div-fix, r=notriddle
Fix order of closing HTML elements in rustdoc output

Initially reported here: https://users.rust-lang.org/t/documentation-itself-parsed-error/76232
2022-05-29 16:25:03 -07:00
Michael Goulet 56026e2fc6
Rollup merge of #97493 - compiler-errors:issue-97490, r=oli-obk
Use `type_is_copy_modulo_regions` check in intrisicck

This one canoncalizes region variables correctly, preventing an ICE

Fixes #97490
2022-05-29 16:25:02 -07:00
est31 311aacf0d0 Remove unused lifetimes from expand_macro
The function doesn't need the lifetimes
of the two arguments be bound together.
2022-05-29 23:53:24 +02:00
Michael Goulet 46d34cc922 Use type_is_copy_modulo_regions check in intrisicck 2022-05-29 13:06:50 -07:00
Guillaume Gomez f1a95b834c Add "no-ex-assign" eslint rule 2022-05-29 21:44:10 +02:00
Guillaume Gomez d39703a6c5 Add "no-duplicate-case" eslint rule 2022-05-29 21:43:37 +02:00
bors 28b891916d Auto merge of #97514 - WaffleLapkin:panick, r=Dylan-DPC
Fix typo (panick -> panic)

Fix typo (panick -> panic) in `std::error` module docs.
2022-05-29 19:42:39 +00:00
Guillaume Gomez 88c3d707a6 Add "no-dupe-keys" eslint rule 2022-05-29 21:42:26 +02:00
Guillaume Gomez 397ad826b0 Add "no-dupe-else-if" eslint rule 2022-05-29 21:42:24 +02:00
Guillaume Gomez 9f79a03ca5 Add "no-dup-args" eslint rule 2022-05-29 21:40:16 +02:00
Guillaume Gomez 4bb728da79 Add "no-debugger" eslint rule 2022-05-29 21:39:44 +02:00
Guillaume Gomez 6b4191f5e0 Add "no-const-assign" eslint rule 2022-05-29 21:38:52 +02:00
bors bef2b7cd1c Auto merge of #97214 - Mark-Simulacrum:stage0-bump, r=pietroalbini
Finish bumping stage0

It looks like the last time had left some remaining cfg's -- which made me think
that the stage0 bump was actually successful. This brings us to a released 1.62
beta though.

This now brings us to cfg-clean, with the exception of check-cfg-features in bootstrap;
I'd prefer to leave that for a separate PR at this time since it's likely to be more tricky.

cc https://github.com/rust-lang/rust/pull/97147#issuecomment-1132845061

r? `@pietroalbini`
2022-05-29 16:28:21 +00:00
bors 9d1aeaeb82 Auto merge of #94214 - nikic:rust-opaque-pointers, r=cuviper
Prepare Rust for opaque pointers

Fix one codegen bug with opaque pointers, and update our IR tests to accept both typed pointer and opaque pointer IR. This is a bit annoying, but unavoidable if we want decent test coverage on both LLVM 14 and LLVM 15.

This prepares Rust for when LLVM will enable opaque pointers by default.
2022-05-29 14:12:42 +00:00
Jan-Erik Rediger 9f68b998db Fix order of closing HTML elements in rustdoc output 2022-05-29 15:22:25 +02:00
bors abc7681a76 Auto merge of #97456 - Bryysen:issue-97319-fix, r=compiler-errors
Improve error message for E0081

Closes #97319
2022-05-29 12:00:30 +00:00
Maybe Waffle f344d569b4 Fix typo (panick -> panic) 2022-05-29 13:14:59 +04:00
bors 0f06824013 Auto merge of #97287 - compiler-errors:type-interner, r=jackh726,oli-obk
Move things to `rustc_type_ir`

Finishes some work proposed in https://github.com/rust-lang/compiler-team/issues/341.

r? `@ghost`
2022-05-29 08:20:13 +00:00
bors 303d916867 Auto merge of #96687 - jyn514:download-rustc, r=Mark-Simulacrum
Move download-rustc from python to rustbuild

- Remove download-rustc handling from bootstrap.py
- Allow a custom `pattern` in `builder.unpack()`
- Only download rustc once another part of bootstrap depends on it.

  This is somewhat necessary since the download functions rely on having a full
  `Builder`, which isn't available until after config parsing finishes.

Helps with https://github.com/rust-lang/rust/issues/94829.
2022-05-29 05:56:09 +00:00
bors 0acc4a3585 Auto merge of #96652 - notriddle:notriddle/self, r=GuillaumeGomez
rustdoc: include impl generics / self in search index

Fixes #92205
2022-05-29 03:15:28 +00:00
bors 84288ed6d5 Auto merge of #97500 - GuillaumeGomez:rollup-ms1bvps, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #96950 (Add regression test for #96395)
 - #97028 (Add support for embedding pretty printers via `#[debugger_visualizer]` attribute)
 - #97478 (Remove FIXME on `ExtCtxt::fn_decl()`)
 - #97479 (Make some tests check-pass)
 - #97482 (ptr::invalid is not equivalent to a int2ptr cast)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-29 00:40:45 +00:00
Guillaume Gomez 774d7ced10
Rollup merge of #97482 - RalfJung:ptr-invalid, r=thomcc
ptr::invalid is not equivalent to a int2ptr cast

I just realized I forgot to update these docs when adding `from_exposed_addr`.
Right now the docs say `invalid` and `from_exposed_addr` are both equivalent to a cast, and that is clearly not what we want.

Cc ``@Gankra``
2022-05-29 01:12:33 +02:00
Guillaume Gomez 37bac9cacb
Rollup merge of #97479 - JohnTitor:make-check-pass, r=compiler-errors
Make some tests check-pass

This touches the tests related to lint, parser, and importing, all of them should be fine with `check-pass`.
r? ``@compiler-errors``
2022-05-29 01:12:32 +02:00
Guillaume Gomez a777d50b24
Rollup merge of #97478 - JohnTitor:fixme-fn-decl, r=compiler-errors
Remove FIXME on `ExtCtxt::fn_decl()`

`ExtCtxt::fn_decl()` is used like `self.fn_decl(..)` or `self.cx.fn_decl(..)`, coverting it to an assoc fn, for example, makes it inconvenience (e.g. `self.cx.fn_decl(..)` would be longer to represent). Given that, it doesn't seem a "FIXME" thing and unused `self` is okay, I think.
2022-05-29 01:12:30 +02:00
Guillaume Gomez 239287f013
Rollup merge of #97028 - ridwanabdillahi:pretty-printer, r=michaelwoerister
Add support for embedding pretty printers via `#[debugger_visualizer]` attribute

Initial support for [RFC 3191](https://github.com/rust-lang/rfcs/pull/3191) in PR https://github.com/rust-lang/rust/pull/91779 was scoped to supporting embedding NatVis files using a new attribute. This PR implements the pretty printer support as stated in the RFC mentioned above.

This change includes embedding pretty printers in the `.debug_gdb_scripts` just as the pretty printers for rustc are embedded today. Also added additional tests for embedded pretty printers. Additionally cleaned up error checking so all error checking is done up front regardless of the current target.

RFC: https://github.com/rust-lang/rfcs/pull/3191
2022-05-29 01:12:30 +02:00
Guillaume Gomez 376163a77c
Rollup merge of #96950 - JohnTitor:issue-96395, r=compiler-errors,oli-obk
Add regression test for #96395

Closes #96395
This repeats "fixed" and "ICE", see https://github.com/rust-lang/glacier/pull/1243#issuecomment-1123768138
I think it's good to add a test before regressing again.
r? ``@compiler-errors`` for quick reviiew

cc ``@oli-obk`` you might want to check as you're familiar with MIR
2022-05-29 01:12:29 +02:00
bors 14f477e78a Auto merge of #97472 - cuviper:rebase-rustc-rayon, r=Mark-Simulacrum
Update to rebased rustc-rayon 0.4

In rayon-rs/rayon#938, miri uncovered a race in `rustc-rayon-core` that had already been fixed in the regular `rayon-core`. I have now rebased that fork onto the latest rayon branch, and published as 0.4. I also updated `indexmap` to bump the dependency.

`Cargo.lock` changes:

    Updating indexmap v1.8.0 -> v1.8.2
    Updating rayon v1.5.1 -> v1.5.3
    Updating rayon-core v1.9.1 -> v1.9.3
    Updating rustc-rayon v0.3.2 -> v0.4.0
    Updating rustc-rayon-core v0.3.2 -> v0.4.1
2022-05-28 22:24:53 +00:00
Bryysen f671bc969f Improve error message for E0081
Previously whenever a duplicate discriminant was detected for an Enum,
we would print the discriminant bits in the diagnostic without any
casting. This caused us to display incorrect values for negative
discriminants. After this PR we format the discriminant signedness
correctly. Also reworded some of the original error
messages.
2022-05-28 23:05:45 +02:00
bors 1fede1753c Auto merge of #97207 - RalfJung:backtrace, r=Mark-Simulacrum
update libbacktrace

It seems like previously we were on a tag of the backtrace repo; not sure if there is a policy that it should always be a tag?

Cc https://github.com/rust-lang/backtrace-rs/pull/462 `@alexcrichton` `@DrMeepster`
2022-05-28 19:30:58 +00:00
Michael Goulet 4638915940 Make TyCtxt implement Interner, make HashStable generic and move to rustc_type_ir 2022-05-28 12:16:05 -07:00
Michael Goulet f05a92d158 Remove some comments, inline interner fn 2022-05-28 11:38:22 -07:00
Michael Goulet 34e05812e0 Fix TyKind lint, make consts no longer fn, etc 2022-05-28 11:38:22 -07:00
Michael Goulet a056a953f0 Initial fixes on top of type interner commit 2022-05-28 11:38:22 -07:00
Wilco Kusee a7015fe816 Move things to rustc_type_ir 2022-05-28 11:38:22 -07:00