about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-05-30Auto merge of #97548 - Dylan-DPC:rollup-9x0va1d, r=Dylan-DPCbors-15/+110
Rollup of 6 pull requests Successful merges: - #97494 (Use Box::new() instead of box syntax in library tests) - #97499 (Remove "sys isn't exported yet" phrase) - #97504 (Ensure source file present when calculating max line number) - #97519 (Re-add help_on_error for download-ci-llvm) - #97531 (Note pattern mismatch coming from `for` loop desugaring) - #97545 (Reword safety comments in core/hash/sip.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-30Rollup merge of #97531 - compiler-errors:for-loop-pat-mismatch, r=davidtwcoDylan DPC-0/+43
Note pattern mismatch coming from `for` loop desugaring Fixes #97163
2022-05-30Rollup merge of #97519 - binggh:readd-help-on-error, r=jyn514Dylan DPC-15/+30
Re-add help_on_error for download-ci-llvm Closes #97503 - Re-added `help_on_error` for `download_component()` and the downstream functions - Removed dead code in `bootstrap.py` Thanks `@jyn514` for the helpful tips! (first contribution here, please let me know if I missed anything out!)
2022-05-30Rollup merge of #97504 - JohnTitor:cleanup-deps, r=davidtwcoDylan DPC-0/+37
Ensure source file present when calculating max line number Resubmission of #89268, fixes #71363 The behavior difference of `simulate-remapped-rust-src-base` is not something we should take into account here, so limiting targets to run the test makes sense, I think. r? `@davidtwco,` and `@estebank,` you might be interested in this change
2022-05-30Auto merge of #97546 - RalfJung:miri, r=oli-obkbors-14/+11
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-30be less redundant redundantRalf Jung-4/+0
2022-05-30Let miri decide the flags to use for the test suiteOli Scherer-2/+0
2022-05-30Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errorsbors-142/+34
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-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-142/+34
2022-05-30update MiriRalf Jung-8/+11
2022-05-30Auto merge of #97489 - GuillaumeGomez:settings-js-disabled, r=notriddlebors-0/+11
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-29Rollup merge of #97530 - GuillaumeGomez:more-eslint-checks, r=jshaMichael Goulet-0/+7
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-29Rollup merge of #97518 - badboy:rustdoc-ul-div-fix, r=notriddleMichael Goulet-1/+1
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-29Rollup merge of #97493 - compiler-errors:issue-97490, r=oli-obkMichael Goulet-0/+12
Use `type_is_copy_modulo_regions` check in intrisicck This one canoncalizes region variables correctly, preventing an ICE Fixes #97490
2022-05-29Use type_is_copy_modulo_regions check in intrisicckMichael Goulet-0/+12
2022-05-29Note pattern mismatch coming from for-loop desugaringMichael Goulet-0/+43
2022-05-29Add "no-ex-assign" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-duplicate-case" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-dupe-keys" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-dupe-else-if" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-dup-args" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-debugger" eslint ruleGuillaume Gomez-0/+1
2022-05-29Add "no-const-assign" eslint ruleGuillaume Gomez-0/+1
2022-05-29Auto merge of #97214 - Mark-Simulacrum:stage0-bump, r=pietroalbinibors-339/+339
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-29Re-add help_on_error for download-ci-llvmbinggh-15/+30
Remove dead code Missing } ./x.py fmt Remove duplicate check Recursively remove all usage of help_on_error
2022-05-29Auto merge of #94214 - nikic:rust-opaque-pointers, r=cuviperbors-285/+256
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-29Fix order of closing HTML elements in rustdoc outputJan-Erik Rediger-1/+1
2022-05-29Auto merge of #97456 - Bryysen:issue-97319-fix, r=compiler-errorsbors-60/+139
Improve error message for E0081 Closes #97319
2022-05-29Auto merge of #97287 - compiler-errors:type-interner, r=jackh726,oli-obkbors-88/+120
Move things to `rustc_type_ir` Finishes some work proposed in https://github.com/rust-lang/compiler-team/issues/341. r? `@ghost`
2022-05-29Auto merge of #96687 - jyn514:download-rustc, r=Mark-Simulacrumbors-352/+418
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-29Auto merge of #96652 - notriddle:notriddle/self, r=GuillaumeGomezbors-62/+251
rustdoc: include impl generics / self in search index Fixes #92205
2022-05-29Ensure source file present when calculating max line numberYuki Okushi-0/+37
Co-authored-by: Ross MacArthur <ross@macarthur.io>
2022-05-29Auto merge of #97500 - GuillaumeGomez:rollup-ms1bvps, r=GuillaumeGomezbors-95/+269
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-29Rollup merge of #97479 - JohnTitor:make-check-pass, r=compiler-errorsGuillaume Gomez-13/+11
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-29Rollup merge of #97028 - ridwanabdillahi:pretty-printer, r=michaelwoeristerGuillaume Gomez-82/+255
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-29Rollup merge of #96950 - JohnTitor:issue-96395, r=compiler-errors,oli-obkGuillaume Gomez-0/+3
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-28Auto merge of #97472 - cuviper:rebase-rustc-rayon, r=Mark-Simulacrumbors-0/+1
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-28Improve error message for E0081Bryysen-60/+139
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-28Fix TyKind lint, make consts no longer fn, etcMichael Goulet-88/+120
2022-05-28Add GUI test for javascript disabled display of settings pageGuillaume Gomez-0/+6
2022-05-28Auto merge of #97461 - eddyb:proc-macro-less-payload, r=bjorn3bors-9/+12
proc_macro: don't pass a client-side function pointer through the server. Before this PR, `proc_macro::bridge::Client<F>` contained both: * the C ABI entry-point `run`, that the server can call to start the client * some "payload" `f: F` passed to that entry-point * in practice, this was always a (client-side Rust ABI) `fn` pointer to the actual function the proc macro author wrote, i.e. `#[proc_macro] fn foo(input: TokenStream) -> TokenStream` In other words, the client was passing one of its (Rust) `fn` pointers to the server, which was passing it back to the client, for the client to call (see later below for why that was ever needed). I was inspired by `@nnethercote's` attempt to remove the `get_handle_counters` field from `Client` (see https://github.com/rust-lang/rust/pull/97004#issuecomment-1139273301), which combined with removing the `f` ("payload") field, could theoretically allow for a `#[repr(transparent)]` `Client` that mostly just newtypes the C ABI entry-point `fn` pointer <sub>(and in the context of e.g. wasm isolation, that's *all* you want, since you can reason about it from outside the wasm VM, as just a 32-bit "function table index", that you can pass to the wasm VM to call that function)</sub>. <hr/> So this PR removes that "payload". But it's not a simple refactor: the reason the field existed in the first place is because monomorphizing over a function type doesn't let you call the function without having a value of that type, because function types don't implement anything like `Default`, i.e.: ```rust extern "C" fn ffi_wrapper<A, R, F: Fn(A) -> R>(arg: A) -> R { let f: F = ???; // no way to get a value of `F` f(arg) } ``` That could be solved with something like this, if it was allowed: ```rust extern "C" fn ffi_wrapper< A, R, F: Fn(A) -> R, const f: F // not allowed because the type is a generic param >(arg: A) -> R { f(arg) } ``` Instead, this PR contains a workaround in `proc_macro::bridge::selfless_reify` (see its module-level comment for more details) that can provide something similar to the `ffi_wrapper` example above, but limited to `F` being `Copy` and ZST (and requiring an `F` value to prove the caller actually can create values of `F` and it's not uninhabited or some other unsound situation). <hr/> Hopefully this time we don't have a performance regression, and this has a chance to land. cc `@mystor` `@bjorn3`
2022-05-28Improve settings page display with disabled javascriptGuillaume Gomez-0/+5
2022-05-28Auto merge of #97383 - dingxiangfei2009:restore-region-scope-tree-query, ↵bors-15/+3
r=dingxiangfei2009 Try to cache region_scope_tree as a query This PR will attempt to restore `region_scope_tree` as a query so that caching works again. It seems that `region_scope_tree` could be re-computed for nested items after all, which could explain the performance regression introduced by #95563. cc `@Mark-Simulacrum` `@pnkfelix` I will try to trigger a perf run here.
2022-05-28Auto merge of #97158 - JakobDegen:dse, r=tmiasko,cjgillotbors-341/+403
Split dead store elimination off dest prop This splits off a part of #96451 . I've added this in as its own pass for now, so that it actually runs, can be tested, etc. In the dest prop PR, I'll stop invoking this as its own pass, so that it doesn't get invoked twice. r? `@tmiasko`
2022-05-28Make some tests check-passYuki Okushi-13/+11
2022-05-28Auto merge of #97476 - Dylan-DPC:rollup-t53nxoe, r=Dylan-DPCbors-25/+134
Rollup of 5 pull requests Successful merges: - #94640 (Partially stabilize `(const_)slice_ptr_len` feature by stabilizing `NonNull::len`) - #97034 (Implement `Hash` for `core::alloc::Layout`) - #97327 (macros: introduce `fluent_messages` macro ) - #97448 (docs: Don't imply that OsStr on Unix is always UTF-8) - #97466 ([bootstrap] Move `sanitize_sh` from `dist` to `install`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-28Rollup merge of #97466 - jyn514:consolidate-install, r=Mark-SimulacrumDylan DPC-25/+25
[bootstrap] Move `sanitize_sh` from `dist` to `install` This is the only place it's used, so there's no need for it to be public in another module. In general, `dist` shouldn't ever touch shell scripts.
2022-05-28Rollup merge of #97327 - ↵Dylan DPC-0/+109
davidtwco:diagnostic-translation-compile-time-validation, r=oli-obk macros: introduce `fluent_messages` macro Adds a new `fluent_messages` macro which performs compile-time validation of the compiler's Fluent resources (i.e. that the resources parse and don't multiply define the same messages) and generates constants that make using those messages in diagnostics more ergonomic. For example, given the following invocation of the macro.. ```rust fluent_messages! { typeck => "./typeck.ftl", } ``` ..where `typeck.ftl` has the following contents.. ```fluent typeck-field-multiply-specified-in-initializer = field `{$ident}` specified more than once .label = used more than once .label-previous-use = first use of `{$ident}` ``` ...then the macro parse the Fluent resource, emitting a diagnostic if it fails to do so... ```text error: could not parse Fluent resource --> $DIR/test.rs:35:28 | LL | missing_message => "./missing-message.ftl", | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: see additional errors emitted error: expected a message field for "missing-message" --> ./missing-message.ftl:1:1 | 1 | missing-message = | ^^^^^^^^^^^^^^^^^^ | ``` ...or generating the following code if it succeeds: ```rust pub static DEFAULT_LOCALE_RESOURCES: &'static [&'static str] = &[ include_str!("./typeck.ftl"), ]; mod fluent_generated { mod typeck { pub const field_multiply_specified_in_initializer: DiagnosticMessage = DiagnosticMessage::fluent("typeck-field-multiply-specified-in-initializer"); pub const field_multiply_specified_in_initializer_label_previous_use: DiagnosticMessage = DiagnosticMessage::fluent_attr( "typeck-field-multiply-specified-in-initializer", "previous-use-label" ); } } ``` When emitting a diagnostic, the generated constants can be used as follows: ```rust let mut err = sess.struct_span_err( span, fluent::typeck::field_multiply_specified_in_initializer ); err.span_label( span, fluent::typeck::field_multiply_specified_in_initializer_label ); err.span_label( previous_use_span, fluent::typeck::field_multiply_specified_in_initializer_label_previous_use ); err.emit(); ``` I'd like to reduce the verbosity of referring to labels/notes/helps with this scheme (though it wasn't much better before), but I'll leave that for a follow-up. r? `@oli-obk` cc `@pvdrz` `@compiler-errors`
2022-05-28Auto merge of #97465 - jyn514:dist-ra, r=Mark-Simulacrumbors-0/+3
Fix `x dist --stage 1 src/tools/rust-analyzer` Previously, this would break because the submodule wasn't checked out. Fixes https://github.com/rust-lang/rust/issues/97464.
2022-05-28Auto merge of #97284 - b-naber:constraint-dyn-impl-suggestion, r=estebankbors-31/+82
Add suggestion for relaxing static lifetime bounds on dyn trait impls in NLL This PR introduces suggestions for relaxing static lifetime bounds on impls of dyn trait items for NLL similar to what is already available in lexical region diagnostics. Fixes https://github.com/rust-lang/rust/issues/95701 r? `@estebank`