about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-10-04Rollup merge of #89508 - jhpratt:stabilize-const_panic, r=joshtriplettJubilee-200/+87
Stabilize `const_panic` Closes #51999 FCP completed in #89006 ```@rustbot``` label +A-const-eval +A-const-fn +T-lang cc ```@oli-obk``` for review (not `r?`'ing as not on lang team)
2021-10-04Rollup merge of #89500 - FabianWolff:issue-87308, r=petrochenkovJubilee-0/+26
Fix ICE with buffered lint referring to AST node deleted by everybody_loops Fixes #87308. Note the following comment: https://github.com/rust-lang/rust/blob/08759c691e2e9799a3c6780ffdf910240ebd4a6b/compiler/rustc_lint/src/early.rs#L415-L417 As it turns out, this is not _always_ a bug, because `-Zunpretty=everybody_loops` causes a lot of AST nodes to be deleted, and thus some buffered lints will refer to non-existent node ids. To fix this, my changes simply ignore buffered lints if `-Zunpretty=everybody_loops` is enabled, which, from my understanding, shouldn't be a big issue because it only affects pretty-printing. Of course, a more elegant solution would only ignore buffered lints that actually point at deleted node ids, but I haven't figured out an easy way of achieving this. For the concrete example in #87308, the buffered lint is created [here](https://github.com/rust-lang/rust/blob/08759c691e2e9799a3c6780ffdf910240ebd4a6b/compiler/rustc_expand/src/mbe/macro_rules.rs#L145-L151) with the `lint_node_id` from [here](https://github.com/rust-lang/rust/blob/08759c691e2e9799a3c6780ffdf910240ebd4a6b/compiler/rustc_expand/src/mbe/macro_rules.rs#L319), i.e. it points at the macro _expansion_, which then gets deleted by `ReplaceBodyWithLoop` [here](https://github.com/rust-lang/rust/blob/08759c691e2e9799a3c6780ffdf910240ebd4a6b/compiler/rustc_interface/src/passes.rs#L377).
2021-10-04Rollup merge of #89483 - hkmatsumoto:patch-diagnostics-2, r=estebankJubilee-139/+139
Practice diagnostic message convention Detected by #89455. r? ```@estebank```
2021-10-04Rollup merge of #89453 - waywardmonkeys:consistent-supertrait-usage, r=nagisaJubilee-77/+77
Consistently use 'supertrait'. A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2021-10-04Rollup merge of #89447 - FabianWolff:issue-89388, r=davidtwcoJubilee-0/+15
Improve error message for missing angle brackets in `[_]::method` Fixes #89388.
2021-10-04Rollup merge of #88451 - theo-lw:issue-87771, r=jackh726Jubilee-0/+13
Fix an ICE caused by type mismatch errors being ignored This PR fixes #87771. It turns out that the check on `compiler/rustc_typeck/src/check/demand.rs:148` leads to the ICE. I removed it because the early return in [`check_expr_assign`](https://github.com/theo-lw/rust/blob/dec7fc3ced5bc3c18d0e5d29921d087f93189cb8/compiler/rustc_typeck/src/check/expr.rs#L928) already prevents unnecessary error messages from the call to `check_expr_coercable_to_type`.
2021-10-04Rollup merge of #83655 - sebpop:arm64-outline-atomics, r=workingjubileeJubilee-0/+16
[aarch64] add target feature outline-atomics Enable outline-atomics by default as enabled in clang by the following commit https://reviews.llvm.org/rGc5e7e649d537067dec7111f3de1430d0fc8a4d11 Performance improves by several orders of magnitude when using the LSE instructions instead of the ARMv8.0 compatible load/store exclusive instructions. Tested on Graviton2 aarch64-linux with x.py build && x.py install && x.py test
2021-10-04Fix suggestion to borrow when casting from pointer to referenceFabian Wolff-6/+44
2021-10-04Add test for duplicated doc aliasesGuillaume Gomez-0/+33
2021-10-04Make `proc_macro_derive_resolution_fallback` a future-breakage lintAaron Hill-0/+72
When `cargo report future-incompatibilities` is stabilized (see #71249), this will cause dependencies that trigger this lint to be included in the report.
2021-10-04Auto merge of #89489 - FabianWolff:issue-89485, r=oli-obkbors-0/+18
Fix unsound optimization with explicit variant discriminants Fixes #89485.
2021-10-04Stabilize try_reserveKornel-17/+0
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-8/+8
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-10-04Move generic error message to separate brancheskadmin-9/+17
This decomposes an error message in generic constants into more specific branches, for better readability.
2021-10-04Stabilize `const_panic`Jacob Pratt-200/+87
2021-10-03Rollup merge of #89505 - Aaron1011:nll-const-test, r=Mark-SimulacrumManish Goregaokar-0/+20
Add regression test for spurious const error with NLL Fixes #55825
2021-10-03Rollup merge of #89472 - nagisa:nagisa/wsa-cleanup, r=dtolnayManish Goregaokar-0/+10
Only register `WSACleanup` if `WSAStartup` is actually ever called See https://github.com/rust-lang/rust/pull/85595 Fixes #85441
2021-10-03Don't suggest replacing region with 'static in NLLAaron Hill-211/+24
Fixes #73159 This is similar to #69350 - if the user didn't initially write out a 'static lifetime, adding 'static in response to a lifetime error is usually the wrong thing to do.
2021-10-03Add regression test for spurious const error with NLLAaron Hill-0/+20
Fixes #55825
2021-10-03Fix ICE with buffered lint referring to AST node deleted by everybody_loopsFabian Wolff-0/+26
2021-10-03Deny `where` clauses on `auto` traitsFabian Wolff-34/+99
2021-10-03Update ui-fulldeps.Camille GILLOT-5/+5
2021-10-03Fix unsound optimization with explicit variant discriminantsFabian Wolff-0/+18
2021-10-03Fix extra `non_snake_case` warning for shorthand field bindingsFabian Wolff-0/+20
2021-10-03Add a test to detect overlapping entries in overview tablesStefan Schindler-0/+26
Detects https://github.com/rust-lang/rust/issues/88545
2021-10-03Try to recover from a `=>` -> `=` or `->` typo in a match armFabian Wolff-0/+52
2021-10-03Combined 4 commits into 1Matthias Kaak-3/+3
Fixed numerus of error message Removed superfluous argument Using pluralize!() instead of code duplication Adjusted a test
2021-10-03Practice diagnostic message conventionHirochika Matsumoto-139/+139
2021-10-03Follow the diagnostic output style guideHirochika Matsumoto-12/+12
2021-10-03Add `deref_into_dyn_supertrait` lint.Charles Lew-0/+41
2021-10-03Move test to correct path.Hameer Abbasi-3/+3
2021-10-03Add test for issue 89118.Hameer Abbasi-0/+95
2021-10-03Auto merge of #84267 - dtolnay:ptrunit, r=nagisabors-45/+60
Make *const (), *mut () okay for FFI Pointer-to-() is used occasionally in the standard library to mean "pointer to none-of-your-business". Examples: - `RawWakerVTable::new` https://doc.rust-lang.org/1.51.0/std/task/struct.RawWakerVTable.html#method.new - `<*const T>::to_raw_parts` https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.to_raw_parts I believe it's useful for the same purpose in FFI signatures, even while `()` itself is not FFI safe. The following should be allowed: ```rust extern "C" { fn demo(pc: *const (), pm: *mut ()); } ``` Prior to this PR, those pointers were not considered okay for an extern signature. ```console warning: `extern` block uses type `()`, which is not FFI-safe --> src/main.rs:2:17 | 2 | fn demo(pc: *const (), pm: *mut ()); | ^^^^^^^^^ not FFI-safe | = note: `#[warn(improper_ctypes)]` on by default = help: consider using a struct instead = note: tuples have unspecified layout warning: `extern` block uses type `()`, which is not FFI-safe --> src/main.rs:2:32 | 2 | fn demo(pc: *const (), pm: *mut ()); | ^^^^^^^ not FFI-safe | = help: consider using a struct instead = note: tuples have unspecified layout ```
2021-10-02Add ui test for empty fields for omitted_patterns lintDevin Ragotzy-3/+15
2021-10-02Auto merge of #89345 - jackh726:89333, r=estebankbors-0/+26
Don't lose binders when printing trait bound suggestion Fixes #89333
2021-10-02Run the #85441 regression test on MSVC onlySimonas Kazlauskas-1/+1
On MinGW toolchains the various features (such as function sections) necessary to eliminate dead function references are disabled due to various bugs. This means that the windows sockets library will most likely remain linked to any mingw toolchain built program that also utilizes libstd. That said, I made an attempt to also enable `function-sections` and `--gc-sections` during my experiments, but the symbol references remained, sadly.
2021-10-02Add test for checking if WS2_32.dll is linkedChristiaan Dirkx-0/+10
2021-10-02Auto merge of #89341 - ↵bors-0/+39
audunhalland:derive-type-params-with-bound-generic-params, r=jackh726 Deriving: Include bound generic params in type parameters for where clause Fixes #89188. The `derive` macro ignored the `for<'s>` needed with the `Fn` trait in that code example. edit: I'm unsure if this might cause regressions. I'm not an experienced compiler developer so I'm not used to thinking about unwanted side effects code changes like this might have.
2021-10-02resolve: Cache module loading for all foreign modulesVadim Petrochenkov-6/+35
It was previously cached for modules loaded from `fn get_module`, but not for modules loaded from `fn build_reduced_graph_for_external_crate_res`. This also makes all foreign modules use their real parent, span and expansion instead of possibly a parent/span/expansion of their reexport. An ICE happening on attempt to decode expansions for foreign enums and traits is avoided. Also local enums and traits are now added to the module map.
2021-10-02Expand one test (from jackh726)Audun Halland-2/+4
2021-10-02Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obkbors-23/+9
Revert #86853 Should fix issue found in #89432
2021-10-02Consistently use 'supertrait'.Bruce Mitchener-77/+77
A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2021-10-02Add regression test for #89432Albin Hedman-0/+9
Co-authored-by: Josh Stone <cuviper@gmail.com>
2021-10-01Auto merge of #89449 - Manishearth:rollup-3alb61f, r=Manishearthbors-22/+87
Rollup of 7 pull requests Successful merges: - #85223 (rustdoc: Clarified the attribute which prompts the warning) - #88847 (platform-support.md: correct ARMv7+MUSL platform triple notes) - #88963 (Coerce const FnDefs to implement const Fn traits ) - #89376 (Fix use after drop in self-profile with llvm events) - #89422 (Replace whitespaces in doctests' name with dashes) - #89440 (Clarify a sentence in the documentation of Vec (#84488)) - #89441 (Normalize after substituting via `field.ty()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-02Revert "Auto merge of #86853 - usbalbin:const_try, r=oli-obk"Albin Hedman-23/+0
This reverts commit c6007fdc7059c677a6c089e8d2915b264c0d1326, reversing changes made to 69c1c6a173dcae20c245348f6c7d19074b6109b7.
2021-10-01Rollup merge of #89441 - Nadrieril:fix-89393, r=tmandryManish Goregaokar-22/+56
Normalize after substituting via `field.ty()` Back in https://github.com/rust-lang/rust/issues/72476 I hadn't understood where the problem was coming from, and only worked around the issue. What happens is that calling `field.ty()` on a field of a generic struct substitutes the appropriate generics but doesn't normalize the resulting type. As a consumer of types I'm surprised that one would substitute without normalizing, feels like a footgun, so I added a comment. Fixes https://github.com/rust-lang/rust/issues/89393.
2021-10-01Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obkManish Goregaokar-0/+31
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? ``@oli-obk`` ``@rustbot`` label T-compiler F-const_trait_impl
2021-10-01Don't use Default, since the impls are different on wasmjackh726-15/+9
2021-10-01Improve error message for missing angle brackets in `[_]::method`Fabian Wolff-0/+15
2021-10-01Auto merge of #88880 - cjgillot:no-krate, r=oli-obkbors-15/+25
Rework HIR API to make invocations of the hir_crate query harder. `hir_crate` forces the recomputation of queries that depend on it. This PR aims at avoiding useless invocations of `hir_crate` by making dependent code go through `tcx.hir()`.