Commit Graph

207932 Commits

Author SHA1 Message Date
Dylan DPC
3800d40dc8
Rollup merge of #102780 - RalfJung:miri-lib-sys, r=Mark-Simulacrum
run Miri CI when std::sys changes

r? `@Mark-Simulacrum`
2022-10-07 22:05:32 +05:30
Dylan DPC
d70e56aef8
Rollup merge of #102779 - TaKO8Ki:fix-type-of-ice-102768, r=fee1-dead
Fix `type_of` ICE

Fixes #102768
2022-10-07 22:05:32 +05:30
Dylan DPC
34dfd82de0
Rollup merge of #102764 - compiler-errors:issue-102762, r=jackh726
Check `WhereClauseReferencesSelf` after all other object safety checks

This fixes the ICE because it causes us to detect another *non-lint* `MethodViolationCode` first, instead of breaking on `WhereClauseReferencesSelf`.

We could also approach this issue by instead returning a vector of *all* of the `MethodViolationCode`s, and just reporting the first one we see, but treating it as a hard error if we return both `WhereClauseReferencesSelf` and some other violation code -- let me know if this is desired.

Fixes #102762
2022-10-07 22:05:31 +05:30
Dylan DPC
fe4200365e
Rollup merge of #102760 - saethlin:dont-reinit-buffer, r=Mark-Simulacrum
Avoid repeated re-initialization of the BufReader buffer

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

We accidentally removed this in https://github.com/rust-lang/rust/pull/98748. It looks so redundant. But it isn't.

The default `Read::read_buf` will defensively initialize the whole buffer, if any of it is indicated to be uninitialized. In uses where reads from the wrapped `Read` impl completely fill the `BufReader`, `initialized` and `filled` are the same, and this extra member isn't required. But in the reported issue, the `BufReader` wraps a `Read` impl which will _never_ fill the whole buffer. So the default `Read::read_buf` implementation repeatedly re-initializes the extra space in the buffer.

This adds back the extra `initialized` member, which ensures that the default `Read::read_buf` only zero-initialized the buffer once, and I've tried to add a comment which explains this whole situation.
2022-10-07 22:05:31 +05:30
Dylan DPC
e461e94165
Rollup merge of #102475 - RalfJung:unsafe, r=dtolnay
unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update

Having a safe `fn` in an `unsafe trait` vs an `unsafe fn` in a safe `trait` are pretty different situations, but the distinction is subtle and can confuse even seasoned Rust developers. So let's have explicit examples of both. I also removed the existing `unsafe trait` example since it was rather strange.

Also the `unsafe_op_in_unsafe_fn` lint can help disentangle the two sides of `unsafe`, so update the docs to account for that.
2022-10-07 22:05:30 +05:30
Dylan DPC
2592609574
Rollup merge of #102300 - scottmcm:simpler-fold-closures, r=Mark-Simulacrum
Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere

Also use that macro to replace a bunch of places that had custom closure-wrappers.

+35 -114 sounds good to me.
2022-10-07 22:05:29 +05:30
Oli Scherer
d90d055691 Allow transmutes between the same types after erasing lifetimes 2022-10-07 16:33:32 +00:00
Michael Goulet
8b9a1f1f4e Remove tuple candidate, nothing special about it 2022-10-07 16:19:21 +00:00
Ralf Jung
fd59d44f58 make const_err a hard error 2022-10-07 18:08:49 +02:00
Deadbeef
e8a2aee50d Remove DefId from some SelectionCandidate variants 2022-10-07 15:14:22 +00:00
Hosshii
462730fdae Add regression test for #102124 2022-10-07 23:36:59 +09:00
Cameron Steffen
ff940db666 Rewrite representability 2022-10-07 09:33:46 -05:00
Jhonny Bill Mena
13d4f27c82 ADD - implement IntoDiagnostic for thorin::Error wrapper 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
a25f939170 Address PR comments
- UPDATE - revert migration of logs

- UPDATE - use derive on LinkRlibError enum

- [Gardening] UPDATE - alphabetically sort fluent_messages

- UPDATE - use PathBuf and unify both AddNativeLibrary to use Display (which is what PathBuf uses when conforming to IntoDiagnosticArg)

- UPDATE - fluent messages sort after rebase
2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
12aa84bdf3 ADD - initial port of link.rs 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
0f97d4a141 DELETE - unused error after PR# 100101 was merged 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
7548d952af UPDATE - resolve fixme and emit errors via Handler 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
67eb01c3f3 UPDATE - codege-ssa errors to new Diagnostic macro name 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
d9197dbbcd UPDATE - migrate write.rs to new diagnostics infra 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
086e70f13e UPDATE - migrate linker.rs to new diagnostics infra 2022-10-07 10:03:45 -04:00
Jhonny Bill Mena
0a2d7f83cb UPDATE - LibDefWriteFailure to accept type instead of formatted string
This follows team’s suggestions in this thread https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20diag.20translation/near/295305249
2022-10-07 10:00:32 -04:00
Jhonny Bill Mena
4e0de5319c ADD - migrate lib.def write fatal error
This diagnostic has no UI test 🤔 Should we add some? If so, how?
2022-10-07 10:00:32 -04:00
Jhonny Bill Mena
b0b072d747 ADD - codegen_ssa initial diags translations machinery
ADD - migrate MissingNativeStaticLibrary fatal error
2022-10-07 10:00:32 -04:00
bors
43c22af267 Auto merge of #101632 - camsteffen:refactor-infer-err, r=lcnr
Remove `TypeckResults` from `InferCtxt`

`InferCtxt` currently has `in_progress_typeck_results` which is only used for some diagnostics during typeck. It adds a lifetime which propagates through a lot of code. This PR moves that field into a new helper struct `TypeErrCtxt`.
2022-10-07 13:54:55 +00:00
Ralf Jung
c30dcff97a review feedback 2022-10-07 15:21:47 +02:00
Ralf Jung
d71a85135b fix Miri 2022-10-07 14:57:41 +02:00
StackOverflowExcept1on
4cf30c0022
Improved documentation for std::io::Error 2022-10-07 15:42:05 +03:00
Ralf Jung
3d93c3848a run Miri CI when std::sys changes 2022-10-07 14:39:07 +02:00
Ralf Jung
6f6433428f add a few more assert_unsafe_precondition 2022-10-07 14:35:12 +02:00
Florian Bartels
4c5d6bb490 Ensure the correct tombstone file is opened 2022-10-07 14:31:12 +02:00
Cameron Steffen
283abbf0e7 Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
Takayuki Maeda
fa767868df fix a ICE #102768 2022-10-07 21:10:08 +09:00
Cameron Steffen
91269fa5b8 Remove a reference from Inherited 2022-10-07 07:06:19 -05:00
Cameron Steffen
349415d1c6 Remove TypeckResults from InferCtxt 2022-10-07 07:06:19 -05:00
Cameron Steffen
4a68373217 Introduce TypeErrCtxt
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't
need to.
2022-10-07 07:06:16 -05:00
Gary Guo
242348343b Fix MIR inlining of asm_unwind 2022-10-07 12:59:38 +01:00
bors
e42c4d7218 Auto merge of #102025 - chenyukang:fix-102002, r=jyn514
Delete the stage1 and stage0-sysroot directories when using download-rustc

Fixes #102002
2022-10-07 10:46:04 +00:00
joboet
5d0211dc03
std: use futex in Once 2022-10-07 12:12:36 +02:00
bors
8437e4ba58 Auto merge of #13362 - WaffleLapkin:go_to_def_fix_doc_include_str, r=Veykril
fix: Make go-to-def work for `#[doc = include_str!("path")]`

See the added test, go-to-def on `#[doc = include_str!("path$0")]` should navigate to `path`.
2022-10-07 09:56:12 +00:00
Maybe Waffle
1c0ec9f0c8 Fix go-to-def for #[doc = include_str!("path")] 2022-10-07 09:04:41 +00:00
bors
5854680388 Auto merge of #102767 - matthiaskrgr:rollup-vcbt81v, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #102577 (Warn about Visual Studio Code branding confusion)
 - #102720 (do not reverse the expected type and found type for ObligationCauseCo…)
 - #102744 (rustdoc: remove unused CSS `.content .item-list`)
 - #102747 (rustdoc: remove unused CSS `.docblock a:not(.srclink)`)
 - #102748 (Disable compressed debug sections on i586-gnu)
 - #102761 (let-else: test else block with non-never uninhabited type)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-07 07:31:53 +00:00
Matthias Krüger
a09e2f6753
Rollup merge of #102761 - est31:let_else_uninhabited_test, r=compiler-errors
let-else: test else block with non-never uninhabited type

let else currently does not allow uninhabited types for the `else` block that aren't `!`. One can maybe think about relaxing this in the future, but if it is done, it should be an explicit choice and not an unexpected side effect of e.g. a refactor. Thus, I'm extending a test that will fail if the behaviour changes.
2022-10-07 07:28:12 +02:00
Matthias Krüger
04459f7a6a
Rollup merge of #102748 - cuviper:i586-gnu-uncompress, r=pietroalbini
Disable compressed debug sections on i586-gnu

Compressed debug is enabled by default for gas (assembly) on Linux/x86
targets, and we started building our own in #102530, but that made our
`compiler_builtins` incompatible with binutils < 2.32. Add an explicit
option to disable that in our crosstool-ng config. Fixes #102703.
2022-10-07 07:28:11 +02:00
Matthias Krüger
d6c05fb9f1
Rollup merge of #102747 - notriddle:notriddle/docblock-a-not-srclink, r=GuillaumeGomez
rustdoc: remove unused CSS `.docblock a:not(.srclink)`

This selector was added in c7312fbae4, because the list of impl items could be nested below `docblock`.

c7312fbae4/src/librustdoc/html/render.rs (L3841-L3845)

Now that rustdoc toggles have been switched to `<details>`, there shouldn't be any need to put things inside docblock containers just to give them disclosure toggles.
2022-10-07 07:28:11 +02:00
Matthias Krüger
a636398897
Rollup merge of #102744 - notriddle:notriddle/content-item-list, r=GuillaumeGomez
rustdoc: remove unused CSS `.content .item-list`

When these rules were added in 4fd061c426 (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag.

In c1b1d6804b, it was changed to use a `<div>` tag, so these rules are both no-ops.
2022-10-07 07:28:10 +02:00
Matthias Krüger
047ff20875
Rollup merge of #102720 - lyming2007:issue-102397-fix, r=compiler-errors
do not reverse the expected type and found type for ObligationCauseCo…

…de of IfExpressionWithNoElse

this will fix #102397
2022-10-07 07:28:10 +02:00
Matthias Krüger
1a2a3249bc
Rollup merge of #102577 - kornelski:non-code-visual-studio, r=wesleywiser
Warn about Visual Studio Code branding confusion

VS Code is a popular companion for Rust, but Microsoft's branding is confusing, and users [may not understand](https://users.rust-lang.org/t/complie-error-when-i-run-rustc/82127) they also need the *other* VS.
2022-10-07 07:28:09 +02:00
bors
cf0fa76f27 Auto merge of #101988 - petrochenkov:flavor2, r=lqd
rustc_target: Refactor internal linker flavors

In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595

`lld_flavor` and `linker_is_gnu` fields are removed from internal target specs, but still parsed from JSON specs using compatibility layer introduced in https://github.com/rust-lang/rust/pull/100552.
r? `@lqd`
2022-10-07 03:35:02 +00:00
Ben Kimock
95ae993bd8 Avoid defensive re-initialization of the BufReader buffer 2022-10-06 23:31:57 -04:00
Takayuki Maeda
57d0278d5c suggest == to the first expr which has ExprKind::Assign 2022-10-07 11:37:33 +09:00