about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-06-12add `@has`Ellen-0/+2
2021-06-12lineEllen-1/+1
2021-06-12dont ICE on `ConstEvaluatable` predicatesEllen-1/+6
2021-06-12Auto merge of #86234 - Mark-Simulacrum:new-vers, r=Mark-Simulacrumbors-1/+1
Bump to 1.55 r? `@Mark-Simulacrum`
2021-06-11Bump to 1.54Mark Rousskov-1/+1
2021-06-12Rollup merge of #86205 - JohnTitor:full-test-for-72293, r=oli-obkYuki Okushi-11/+17
Run full const-generics test for issue-72293 Closes #72293 r? ```@oli-obk```
2021-06-12Rollup merge of #86174 - lqd:const-ub-align, r=RalfJungYuki Okushi-0/+48
Detect incorrect vtable alignment during const eval This PR fixes #86132 by detecting invalid alignment values for trait objects in the interpreter, and emitting an error about this conversion failure, to avoid the ICE. I've noticed that the error emitted at https://github.com/rust-lang/rust/blob/a50d72158e08e02cfc051b863017bdbd2c45b637/compiler/rustc_mir/src/interpret/traits.rs#L163-L166 doesn't seem to be present in the const-ub tests, so I've tried adding a test that triggers both of these cases: one for the invalid size, and another for the invalid alignment that #86132 tracks (I have found different magic values triggering different `Align::from_bytes` errors than the "power of 2" one, if need be). However, when doing that, I *cannot* for the life of me figure out the correct incantation to make these 2 errors trigger with the "it is undefined behavior to use this value" message rather than the "any use of this value will cause an error" lint. I've tried Oli's suggestions of different values, tuples and arrays, using the transparent wrapper trick from the other tests and I was only able to trigger the regular const-ub errors about the size of the vtable, or that the drop pointer was invalid. Maybe these "type validation failed" errors happen before this part of the interpreter is reached and there just needs some magic incorrect values to bypass them, I don't know. Since this fixes an ICE, and if the constants are indeed used, these 2 tests will turn into a hard error, I thought I'd open the PR anyways. And if ```@RalfJung``` you know of a way I could manage that (if you think that these tests are worth checking that the `throw_ub_format!` does indeed create const-ub errors as we expect) I'd be grateful. For that reason, r? ```@RalfJung``` and cc ```@oli-obk.```
2021-06-12Rollup merge of #86153 - tmiasko:dummy-span, r=estebankYuki Okushi-8/+8
Print dummy spans as `no-location` Fixes #58808.
2021-06-12Rollup merge of #85823 - fee1-dead:borrowck-0, r=jackh726Yuki Okushi-0/+20
Do not suggest ampmut if rhs is already mutable Removes invalid suggestion in #85765, although it should highlight the user type instead of the local variable. Looking at the comments of this line: https://github.com/rust-lang/rust/blob/84b1005bfd22e2cb2a4c13b0b81958fe72628354/compiler/rustc_mir_build/src/build/matches/mod.rs#L2107 It was intentionally set to `None`, causing it to highlight the local variable instead. I am not sure if I will be able to fix it. Fixes #85765
2021-06-12Rollup merge of #85800 - BoxyUwU:const-param-default-diagnostics, r=oli-obkYuki Okushi-12/+40
Fix some diagnostic issues with const_generics_defaults feature gate This PR makes a few changes: - print out const param defaults in "lifetime ordering" errors rather than discarding them - update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message - fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
2021-06-11Auto merge of #86116 - FabianWolff:issue-86100, r=varkorbors-0/+80
Suggest a trailing comma if a 1-tuple is expected and a parenthesized expression is found This pull request fixes #86100. The following code: ```rust fn main() { let t: (i32,) = (1); } ``` currently produces: ``` warning: unnecessary parentheses around assigned value --> test.rs:2:21 | 2 | let t: (i32,) = (1); | ^^^ help: remove these parentheses | = note: `#[warn(unused_parens)]` on by default error[E0308]: mismatched types --> test.rs:2:21 | 2 | let t: (i32,) = (1); | ------ ^^^ expected tuple, found integer | | | expected due to this | = note: expected tuple `(i32,)` found type `{integer}` error: aborting due to previous error; 1 warning emitted ``` With my changes, I get the same warning and the following error: ``` error[E0308]: mismatched types --> test.rs:2:21 | 2 | let t: (i32,) = (1); | ------ ^^^ expected tuple, found integer | | | expected due to this | = note: expected tuple `(i32,)` found type `{integer}` help: use a trailing comma to create a tuple with one element | 2 | let t: (i32,) = (1,); | ^^^^ ``` i.e. I have added a suggestion to add a trailing comma to create a 1-tuple. This suggestion is only issued if a 1-tuple is expected and the expression (`(1)` in the example above) is surrounded by parentheses and does not already have a tuple type. In this situation, I'd say that it is pretty likely that the user meant to create a tuple.
2021-06-11Auto merge of #85994 - tmiasko:monomorphic-needs-drop, r=RalfJungbors-0/+37
Disallow non-monomorphic calls to `needs_drop` in interpreter otherwise evaluation could change after further substitutions.
2021-06-11Auto merge of #86204 - alexcrichton:wasm-simd-stable, r=Amanieubors-4/+0
std: Stabilize wasm simd intrinsics This commit performs two changes to stabilize Rust support for WebAssembly simd intrinsics: * The stdarch submodule is updated to pull in rust-lang/stdarch#1179. * The `wasm_target_feature` feature gate requirement for the `simd128` feature has been removed, stabilizing the name `simd128`. This should conclude the FCP started on #74372 and... Closes #74372
2021-06-10std: Stabilize wasm simd intrinsicsAlex Crichton-4/+0
This commit performs two changes to stabilize Rust support for WebAssembly simd intrinsics: * The stdarch submodule is updated to pull in rust-lang/stdarch#1179. * The `wasm_target_feature` feature gate requirement for the `simd128` feature has been removed, stabilizing the name `simd128`. This should conclude the FCP started on #74372 and... Closes #74372
2021-06-11Auto merge of #85961 - 1000teslas:issue-71519-fix, r=petrochenkovbors-0/+34
MVP for using rust-lld as part of cc Will fix #71519. I need to figure out how to write a test showing that lld is used instead of whatever linker cc normally uses. When I manually run rustc using `echo 'fn main() {}' | RUSTC_LOG=rustc_codegen_ssa::back::link=debug ./rustc -Clinker-flavor=gcc-lld --crate-type bin -Clink-arg=-Wl,-v` (thanks to bjorn3 on Zulip), I can see that lld is used, but I'm not sure how to inspect that output in a test.
2021-06-11Run full const-generics test for issue-72293Yuki Okushi-11/+17
2021-06-10Auto merge of #80080 - rylev:qpath-on-struct, r=petrochenkovbors-119/+267
Allow qualified paths in struct construction (both expressions and patterns) Fixes #79658
2021-06-10Auto merge of #86098 - pietroalbini:test-stable, r=Mark-Simulacrumbors-22/+67
Add the x86_64-gnu-stable builder During the 1.52 release process we had to deal with some commits that passed the test suite on the nightly branch but failed on the beta or stable branch. In that case it was due to some UI tests including the channel name in the output, but other changes might also be dependent on the channel. This commit adds a new CI job that runs the Linux x86_64 test suite with the stable branch, ensuring nightly changes also work as stable. To ensure the new job works the following other changes are present: * The `ui-fulldeps/session-derive-errors.rs` test has been disabled on beta and stable, which required adding support for `// ignore-{channel}` and `// only-{channel}`. * The `rustdoc/intra-doc/field.rs` has been fixed. r? `@Mark-Simulacrum` fixes https://github.com/rust-lang/release-team/issues/11
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-817/+86
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-119/+267
position.
2021-06-10gcc-lld mvp1000teslas-0/+34
ignore test if rust-lld not found create ld -> rust-lld symlink at build time instead of run time for testing in ci copy instead of symlinking remove linux check test for linker, suggestions from bjorn3 fix overly restrictive lld matcher use -Zgcc-ld flag instead of -Clinker-flavor refactor code adding lld to gcc path revert ci changes suggestions from petrochenkov rename gcc_ld to gcc-ld in dirs
2021-06-10Rollup merge of #86175 - RalfJung:miri, r=RalfJungYuki Okushi-9/+15
update Miri We had some nice PRs land today, let's ship those. :) Cc `@rust-lang/miri` r? `@ghost`
2021-06-10Rollup merge of #86113 - the8472:doctest-lld, r=Mark-SimulacrumYuki Okushi-16/+27
build doctests with lld if use-lld = true results when running `./x.py test library/core --doc --stage 0`: ``` # OLD test result: FAILED. 2844 passed; 6 failed; 28 ignored; 0 measured; 0 filtered out; finished in 21.13s # NEW test result: FAILED. 2844 passed; 6 failed; 28 ignored; 0 measured; 0 filtered out; finished in 11.92s ```
2021-06-10Rollup merge of #85997 - jyn514:rustdoc-diff, r=Mark-SimulacrumYuki Okushi-9/+21
rustdoc: Print a warning if the diff when comparing to old nightlies is empty This avoids confusing situations where it's unclear whether there's a bug in the diff tool or not: ``` 26: `@has` check failed `XPATH PATTERN` did not match // `@has` - '//code/a[`@href="{{channel}}/std/primitive.i32.html"]'` 'i32' Encountered 6 errors ------------------------------------------ info: generating a diff against nightly rustdoc failures: [rustdoc] rustdoc/primitive-reexport.rs ```
2021-06-09detect incorrect vtable alignment during const eval instead of ICE-ingRémy Rakic-0/+48
also add tests for these 2 kinds of errors for size and alignment, as the existing size check wasn't apparently tested
2021-06-09update MiriRalf Jung-9/+15
2021-06-09Auto merge of #86003 - pnkfelix:issue-84297-revert-81238, r=Mark-Simulacrumbors-200/+27
Make copy/copy_nonoverlapping fn's again Make copy/copy_nonoverlapping fn's again, rather than intrinsics. This a short-term change to address issue #84297. It effectively reverts PRs #81167 #81238 (and part of #82967), #83091, and parts of #79684.
2021-06-09Auto merge of #86118 - spastorino:tait-soundness-bug, r=nikomatsakisbors-0/+103
Create different inference variables for different defining uses of TAITs Fixes #73481 r? `@nikomatsakis` cc `@oli-obk`
2021-06-09Auto merge of #86107 - Smittyvb:peephole-optim-eq-bool, r=wesleywiserbors-0/+166
Peephole optimize `x == false` and `x != true` This adds peephole optimizations to make `x == false`, `false == x`, `x != true`, and `true != x` get optimized to `!x` in the `instcombine` MIR pass. That pass currently handles `x == true` -> `x` already.
2021-06-09Rollup merge of #86159 - ehuss:update-cargo, r=ehussYuki Okushi-0/+0
Update cargo 11 commits in 0cecbd67323ca14a7eb6505900d0d7307b00355b..aa8b09297bb3156b849e73db48af4cd050492fe6 2021-06-01 20:09:13 +0000 to 2021-06-09 00:28:53 +0000 - Add `--prune` option for cargo-tree (rust-lang/cargo#9520) - Fix typo in gitignore docs. (rust-lang/cargo#9556) - Fix typos in command_prelude.rs (rust-lang/cargo#9552) - Make clippy happy (rust-lang/cargo#9551) - Remove some dead code. (rust-lang/cargo#9546) - Add additional test for CJK progress width (rust-lang/cargo#9515) - Pull in semver 1.0.3 'x' fix (rust-lang/cargo#9544) - Add some tracking issues to unstable docs. (rust-lang/cargo#9540) - Update documentation for include/exclude. (rust-lang/cargo#9538) - Bump mdbook version for contrib guide. (rust-lang/cargo#9534) - Replace deprecated `[replace]` references with `[patch]` (rust-lang/cargo#9533)
2021-06-09Rollup merge of #86158 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## reference 4 commits in 9c68af3ce6ccca2395e1868addef26a0542e9ddd..8f598e2af6c25b4a7ee88ef6a8196d9b8ea50ca8 2021-05-24 09:53:32 -0700 to 2021-06-01 19:00:46 +0100 - Add crate and module to glossary. (rust-lang-nursery/reference#1016) - Fix type_length_limit example. (rust-lang-nursery/reference#1026) - Rearrange HRTB grammar. (rust-lang-nursery/reference#1011) - Revert "Temporarily remove pat_param." (rust-lang-nursery/reference#1010) ## rustc-dev-guide 6 commits in 50de7f0682adc5d95ce858fe6318d19b4b951553..c8da5bfd1c7c71d90ef1646f5e0a9f6609d5c78a 2021-05-20 15:02:20 +0200 to 2021-06-04 09:08:56 +0200 - Fix some links (rust-lang/rustc-dev-guide#1137) - explain Miri engine vs Miri-the-tool - Add more information about no_hash query modifier. (rust-lang/rustc-dev-guide#1133) - improve section introduction - not all tools require waiting for a nightly release before they can be fixed - Describe the difference of rustc_lint vs rustc_lint_defs.
2021-06-09Rollup merge of #86128 - jsha:render-impl-into-mod, r=GuillaumeGomezYuki Okushi-78/+86
Refactor: Extract render_summary from render_impl. This allows for a more readable straight-through logic in render_impl without need for a closure. I think this will make #85970 a bit more of a straightforward change. This is a pure refactoring. I've verified that the output of `x.py doc library/std` is byte-for-byte identical. r? `@GuillaumeGomez`
2021-06-09Rollup merge of #86124 - Aaron1011:ambig-macro-name, r=varkorYuki Okushi-2/+2
Include macro name in 'local ambiguity' error Currently, we only point at the span of the macro argument. When the macro call is itself generated by another macro, this can make it difficult or impossible to determine which macro is responsible for producing the error.
2021-06-09Rollup merge of #85982 - alexcrichton:doc-safe-wasm, r=jyn514Yuki Okushi-0/+7
Enable rustdoc to document safe wasm intrinsics This commit fixes an issue not found during #84988 where rustdoc is used to document cross-platform intrinsics but it was requiring that functions which use `#[target_feature]` are `unsafe` erroneously, even if they're WebAssembly specific. Rustdoc today, for example, already has a special case where it enables annotations like `#[target_feature(enable = "simd128")]` on platforms other than WebAssembly. The purpose of this commit is to relax the "require all `#[target_feature]` functions are `unsafe`" requirement for all targets whenever rustdoc is running, enabling all targets to fully document other targets, such as WebAssembly, where intrinsics functions aren't always `unsafe`.
2021-06-09Rollup merge of #85957 - BoxyUwU:rustdoc-const-generic-defaults, r=oli-obkYuki Okushi-10/+39
Display defaults on const params- rustdoc previously rustdoc would render this struct declaration: `pub struct Foo<const N: usize = 10>;` as: `pub struct Foo<const N: usize>;` this PR changes it to render correctly
2021-06-08Update cargoEric Huss-0/+0
2021-06-08Update booksEric Huss-0/+0
2021-06-09Print dummy spans as `no-location`Tomasz Miąsko-8/+8
2021-06-08Update Mirihyd-dev-10/+9
2021-06-08Auto merge of #86127 - JohnTitor:rollup-0c6mp3j, r=JohnTitorbors-22/+37
Rollup of 11 pull requests Successful merges: - #85906 (Use `Iterator::find` instead of open-coding it) - #85951 (Update the documentation of `-C force-unwind-tables` for #83482) - #85985 (Clarify documentation of slice sorting methods) - #85989 (Remove rustfmt tests from top-level .gitattributes) - #86074 (Default panic message should print Box<dyn Any>) - #86078 (Type page font weight) - #86090 (:arrow_up: rust-analyzer) - #86095 (Search description codeblock) - #86096 (Comment out unused error codes and add description for E0316) - #86101 (Correct type signature in doc for Bound::as_mut) - #86103 (Remove lifetime hack) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-07Refactor: Extract render_summary from render_impl.Jacob Hoffman-Andrews-78/+86
This allows for a more readable straight-through logic in render_impl without need for a closure.
2021-06-08Rollup merge of #86096 - FabianWolff:ec-E0316, r=GuillaumeGomezYuki Okushi-0/+1
Comment out unused error codes and add description for E0316 I have added an extended description of `E0316` and commented out a bunch of unused error codes to make clear the fact that they are no longer in use. You can check for yourself with ```shell for ec in \ E0314 E0315 E0473 E0474 E0475 E0479 E0480 E0481 \ E0483 E0484 E0485 E0486 E0487 E0488 E0489 do if [ ! -z "`grep -r $ec compiler/* --exclude-dir=rustc_error_codes`" ] then echo $ec false fi done ``` i.e. these error codes appear nowhere in the compiler code and thus cannot be emitted. r? ```@GuillaumeGomez```
2021-06-08Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jshaYuki Okushi-1/+6
Search description codeblock The codeblocks are not displayed correctly: ![Screenshot from 2021-06-07 11-11-53](https://user-images.githubusercontent.com/3050060/120991915-5fb05680-c782-11eb-9b32-973a64b1f631.png) This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it): ![Screenshot from 2021-06-07 11-12-00](https://user-images.githubusercontent.com/3050060/120991919-6048ed00-c782-11eb-8ac5-c3aa6508bc8b.png) r? ```@jsha```
2021-06-08Rollup merge of #86090 - lnicola:rust-analyzer-2021-06-07, r=jonas-schievinkYuki Okushi-15/+19
:arrow_up: rust-analyzer
2021-06-08Rollup merge of #86078 - GuillaumeGomez:type-page-font-weight, r=jshaYuki Okushi-2/+8
Type page font weight Fixes https://github.com/rust-lang/rust/issues/86069. r? ```@jsha```
2021-06-08Rollup merge of #86074 - reaganmcf:iss-86039, r=jyn514Yuki Okushi-2/+2
Default panic message should print Box<dyn Any> Closes #86039 Prior to this patch, the panic message from running the following code would be `thread 'main' panicked at 'Box<Any>'...` ```rust use std::panic::panic_any; fn main() { panic_any(42); } ``` This patch updates the phrasing to be more consistent. It now instead shows the following panic message: ``` thread 'main' panicked at 'Box<dyn Any>', ... ``` It's a very small fix 😄
2021-06-08Rollup merge of #85951 - hyd-dev:force-unwind-tables, r=steveklabnikYuki Okushi-2/+1
Update the documentation of `-C force-unwind-tables` for #83482 `panic=unwind` does not require `force-unwind-tables` to be "yes" anymore. I forgot to update this in #83482.
2021-06-07Include macro name in 'local ambiguity' errorAaron Hill-2/+2
Currently, we only point at the span of the macro argument. When the macro call is itself generated by another macro, this can make it difficult or impossible to determine which macro is responsible for producing the error.
2021-06-07Enable rustdoc to document safe wasm intrinsicsAlex Crichton-0/+7
This commit fixes an issue not found during #84988 where rustdoc is used to document cross-platform intrinsics but it was requiring that functions which use `#[target_feature]` are `unsafe` erroneously, even if they're WebAssembly specific. Rustdoc today, for example, already has a special case where it enables annotations like `#[target_feature(enable = "simd128")]` on platforms other than WebAssembly. The purpose of this commit is to relax the "require all `#[target_feature]` functions are `unsafe`" requirement for all targets whenever rustdoc is running, enabling all targets to fully document other targets, such as WebAssembly, where intrinsics functions aren't always `unsafe`.
2021-06-07Add more TAIT multiple defining uses test casesSantiago Pastorino-0/+72