about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-03-03Bless test where order of error message changedRyan Levick-2/+2
2021-03-03Fix testsRyan Levick-4/+9
2021-03-03Add tests and support two more noop methodsRyan Levick-0/+73
2021-03-02Rollup merge of #82627 - JohnTitor:issue-82612, r=estebankYuki Okushi-0/+52
Erase late bound regions to avoid ICE Fixes #82612, which is caused by #81769. r? `@estebank`
2021-03-02Rollup merge of #82593 - sunfishcode:wasi-docs, r=alexcrichtonYuki Okushi-0/+32
Teach rustdoc how to display WASI. As a followup to [this comment] in #82420, this patch teaches rustdoc how to display WASI. [this comment]: https://github.com/rust-lang/rust/pull/82420#issuecomment-784523826 r? `@alexcrichton`
2021-03-02Rollup merge of #82579 - osa1:issue82566, r=estebankYuki Okushi-0/+122
Fix turbofish recovery with multiple generic args This consists of two commits, each can be individually reviewed. - First commit fixes the issue in [this comment](https://github.com/rust-lang/rust/issues/82566#issuecomment-786924466). - Second commit fixes #82566 --- r? ````@estebank````
2021-03-02Rollup merge of #82516 - PoignardAzur:inherent-impl-ty, r=oli-obkYuki Okushi-18/+71
Add incomplete feature gate for inherent associate types. Mentored by ``````@oli-obk`````` So far the only change is that instead of giving an automatic error, the following code compiles: ```rust struct Foo; impl Foo { type Bar = isize; } ``` The backend work to make it actually usable isn't there yet. In particular, this: ```rust let x : Foo::Bar; ``` will give you: ```sh error[E0223]: ambiguous associated type --> /$RUSTC_DIR/src/test/ui/assoc-inherent.rs:15:13 | LL | let x : Foo::Bar; | ^^^^^^^^ help: use fully-qualified syntax: `<Foo as Trait>::Bar` ```
2021-03-02Rollup merge of #82662 - GuillaumeGomez:doc-attr-check, r=jyn514Guillaume Gomez-0/+38
Warn about unknown doc attributes Fixes #82652. For the text error, I decided to go for "invalid" instead of "unknown". What do you think? r? `@jyn514`
2021-03-02Rollup merge of #82655 - SkiFire13:fix-issue-81314, r=estebankGuillaume Gomez-16/+61
Highlight identifier span instead of whole pattern span in `unused` lint Fixes #81314 This pretty much just changes the span highlighted in the lint from `pat_sp` to `ident.span`. There's however an exception, which is in patterns with shorthands like `Point { y, ref mut x }`, where a suggestion to change just `x` would be invalid; in those cases I had to keep the pattern span. Another option would be suggesting something like `Point { y, x: ref mut _x }`. I also added a new test since there weren't any test that checked the `unused` lint with optional patterns.
2021-03-02Rollup merge of #82598 - GuillaumeGomez:rustdoc-rustc-pass, r=jyn514Guillaume Gomez-0/+15
Check stability and feature attributes in rustdoc Fixes #82588. cc `@Nemo157` `@camelid` r? `@jyn514`
2021-03-02Rollup merge of #82018 - jyn514:no-dummy-cache, r=camelid,GuillaumeGomezGuillaume Gomez-1/+3
Remove the dummy cache in `DocContext`; delete RenderInfo The same information is available everywhere; the only reason the dummy cache was needed is because it was previously stored in three different places. This consolidates the info a bit so the cache in `DocContext` is used throughout. As a bonus, it also completely removes `RenderInfo`. - Return a `Cache` from `run_global_ctxt`, not `RenderInfo` - Remove the unused `render_info` from `run_renderer` - Remove RenderInfo altogether Helps with https://github.com/rust-lang/rust/pull/82014. The next step is to move the `populate()` call before the `collect_intra_doc_links` pass, which currently breaks because a) lots of the cache is populated in early passes, and b) intra_doc_links itself sets some info with `register_res`. I'm working on separate PR for that to avoid making too many big changes at once. r? `@GuillaumeGomez`
2021-03-02Rollup merge of #81932 - jyn514:rustdoc-logging, r=Mark-SimulacrumGuillaume Gomez-1/+1
Always compile rustdoc with debug logging enabled when `download-rustc` is set Previously, logging at DEBUG or below would always be silenced, because rustc compiles tracing with the `static_max_level_info` feature. That makes sense for release artifacts, but not for developing rustdoc. Instead, this compiles two different versions of tracing: one in the release artifacts, distributed in the sysroot, and a new version compiled by rustdoc. Since `rustc_driver` is always linked to the version of sysroot, this copy/pastes `init_env_logging` into rustdoc. To avoid compiling an unnecessary version of tracing when `download-rustc` isn't set, this adds a new `using-ci-artifacts` feature for rustdoc and passes that feature in bootstrap. Addresses https://github.com/rust-lang/rust/issues/81930. This builds on https://github.com/rust-lang/rust/pull/79540. r? `@Mark-Simulacrum`
2021-03-02Rollup merge of #80734 - abonander:ab/issue-66693, r=oli-obkGuillaume Gomez-4/+92
check that first arg to `panic!()` in const is `&str` closes #66693 ~~TODO: regression test~~ cc `@RalfJung` for error message wording
2021-03-01Auto merge of #82663 - jyn514:rollup-xh3cb0c, r=jyn514bors-0/+37
Rollup of 8 pull requests Successful merges: - #81210 (BTreeMap: correct node size test case for choices of B) - #82360 (config.toml parsing error improvements) - #82428 (Update mdbook) - #82480 (Remove `ENABLE_DOWNLOAD_RUSTC` constant) - #82578 (Add some diagnostic items for Clippy) - #82620 (Apply lint restrictions from renamed lints) - #82635 (Fix typos in rustc_infer::infer::nll_relate) - #82645 (Clarify that SyncOnceCell::set blocks.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-01Add tests for doc attribute checkGuillaume Gomez-0/+38
2021-03-01Auto merge of #82587 - taiki-e:unaligned_references, r=oli-obkbors-0/+68
Enable report_in_external_macro in unaligned_references Fixes an issue where `unaligned_references` is not triggered in external macros, unlike `safe_packed_borrows`. Also, given that this lint is planned to eventually change to hard error (#82525), it would make sense for this lint to be triggered for external macros as well. See https://github.com/taiki-e/pin-project-lite/pull/55#issuecomment-787038676 and https://github.com/taiki-e/pin-project-lite/pull/55#issuecomment-787052874 for more. r? `@RalfJung`
2021-03-01check that first arg to `panic!()` in const is `&str`Austin Bonander-4/+92
2021-03-01Rollup merge of #82620 - jyn514:apply-renamed-lints, r=ManishearthJoshua Nelson-0/+37
Apply lint restrictions from renamed lints Previously, if you denied the old name of a renamed lint, it would warn about using the new name, but otherwise do nothing. Now, it will behave the same as if you'd used the new name. Fixes https://github.com/rust-lang/rust/issues/82615. r? `@ehuss`
2021-03-01Auto merge of #78360 - tmiasko:storage-markers, r=wesleywiser,oli-obkbors-3/+127
Remove storage markers if they won't be used during code generation The storage markers constitute a substantial portion of all MIR statements. At the same time, for builds without any optimizations, the storage markers have no further use during and after MIR optimization phase. If storage markers are not necessary for code generation, remove them.
2021-03-01Add regression testGiacomo Stevanato-0/+45
2021-03-01Rollup merge of #82643 - Aaron1011:test-macro-attrs, r=petrochenkovYuki Okushi-371/+2249
Add more proc-macro attribute tests r? `@petrochenkov`
2021-03-01Rollup merge of #82531 - GuillaumeGomez:gui-tests-start, r=jyn514Yuki Okushi-0/+37
Add GUI tests The start of a lot more of GUI tests! \o/ One test is to ensure that the search input can always be selected in all rustdoc "modes" (mobile, tablet mostly) whereas the second checks the shortcuts. r? `@jyn514`
2021-03-01Remove `krate.version`; fix `crate_version` in JSONJoshua Nelson-1/+3
Previously, `JsonRenderer::after_krate` called `krate.version.clone()`. The problem was it did that after the version was already moved into the cache, so it would always be None. The fix was to get the version from the cache instead.
2021-02-28Add more proc-macro attribute testsAaron Hill-371/+2249
2021-02-28Remove deleted pass from rustdoc test suiteJoshua Nelson-1/+1
`src/test/rustdoc-ui/deprecated-attrs.rs` tells rustdoc to run the `collapse-docs` pass, which no longer exists (it was removed in https://github.com/rust-lang/rust/pull/80261). Rustdoc doesn't actually give a proper diagnostic here; instead it prints an `error!` log. Now that tracing is compiled unconditionally, the log is now being emitted by default, because it's at the error level. rustdoc shouldn't be using `error!` logging for diagnostics in the first place, but in the meantime this change gets the testsuite to pass.
2021-02-28Bless some testsGiacomo Stevanato-16/+16
2021-02-28Add a test in src/test/rustdoc/doc-cfg.rsDan Gohman-0/+32
2021-02-28Add GUI testsGuillaume Gomez-0/+37
2021-02-28Erase late bound regions to avoid ICEYuki Okushi-0/+52
2021-02-28Apply lint restrictions from renamed lintsJoshua Nelson-0/+37
Previously, if you denied the old name of a renamed lint, it would warn about using the new name, but otherwise do nothing. Now, it will behave the same as if you'd used the new name.
2021-02-28Use -O in try_identity test that requires storage markersTomasz Miąsko-1/+1
2021-02-28Remove storage markers if they won't be used during code generationTomasz Miąsko-2/+126
The storage markers constitute a substantial portion of all MIR statements. At the same time, for builds without any optimizations, the storage markers have no further use during and after MIR optimization phase. If storage markers are not necessary for code generation, remove them.
2021-02-28Update rustdoc test to make it work with newly added rustc passesGuillaume Gomez-0/+2
2021-02-28Add test for rustdoc new check passGuillaume Gomez-0/+13
2021-02-27Rollup merge of #82563 - lucas-deangelis:issue-82209-fix, r=jyn514Dylan DPC-0/+11
Fix intra-doc handling of `Self` in enum Fixes #82209
2021-02-27Rollup merge of #81856 - Smittyvb:utf16-warn, r=matthewjasperDylan DPC-0/+0
Suggest character encoding is incorrect when encountering random null bytes This adds a note whenever null bytes are seen at the start of a token unexpectedly, since those tend to come from UTF-16 encoded files without a [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) (if a UTF-16 BOM appears it won't be valid UTF-8, but if there is no BOM it be both valid UTF-16 and valid but garbled UTF-8). This approach was suggested in https://github.com/rust-lang/rust/issues/73979#issuecomment-653976451. Closes #73979.
2021-02-27Enable report_in_external_macro in unaligned_referencesTaiki Endo-0/+68
2021-02-27Recover from X<Y,Z> when parsing const exprÖmer Sinan Ağacan-3/+69
This adds recovery when in array type syntax user writes [X; Y<Z, ...>] instead of [X; Y::<Z, ...>] Fixes #82566 Note that whenever we parse an expression and know that the next token cannot be `,`, we should be calling check_mistyped_turbofish_with_multiple_type_params for this recovery. Previously we only did this for statement parsing (e.g. `let x = f<a, b>;`). We now also do it when parsing the length field in array type syntax.
2021-02-27Fix turbofish recovery with multiple generic argsÖmer Sinan Ağacan-0/+56
check_mistyped_turbofish_with_multiple_type_params was previously expecting type arguments between angle brackets, which is not right, as we can also see const expressions. We now use generic argument parser instead of type parser. Test with one, two, and three generic arguments added to check consistentcy between 1. check_no_chained_comparison: Called after parsing a nested binop application like `x < A > ...` where angle brackets are interpreted as binary operators and `A` is an expression. 2. check_mistyped_turbofish_with_multiple_type_params: called by `parse_full_stmt` when we expect to see a semicolon after parsing an expression but don't see it. (In `T2<1, 2>::C;`, the expression is `T2 < 1`)
2021-02-27Rollup merge of #82494 - estebank:issue-82455, r=petrochenkovDylan DPC-2/+32
Substitute erased lifetimes on bad placeholder type Fix #82455.
2021-02-27Rollup merge of #82442 - Aaron1011:fix/closure-mut-crash, r=matthewjasperDylan DPC-0/+40
Skip emitting closure diagnostic when closure_kind_origins has no entry Fixes #82438 This map is not guarnateed to have an entry for a closure.
2021-02-27Rollup merge of #82419 - petrochenkov:inertord, r=Aaron1011Dylan DPC-38/+112
expand: Preserve order of inert attributes during expansion Fixes https://github.com/rust-lang/rust/issues/67839 Fixes https://github.com/rust-lang/rust/issues/81871 r? `````@Aaron1011`````
2021-02-27Rollup merge of #82404 - nagisa:nagisa/hexagon-enums-llvm-comps, r=petrochenkovDylan DPC-5/+6
Test hexagon-enum only when llvm target is present See https://github.com/rust-lang/rust/pull/82379#issuecomment-783439754 r? ``````@petrochenkov`````` ``````@bors`````` rollup
2021-02-27Rollup merge of #82370 - ↵Dylan DPC-103/+88
0yoyoyo:update-issue-81650-point-anonymous-lifetime, r=estebank Improve anonymous lifetime note to indicate the target span Improvement for #81650 Cc #81995 Message after this improvement: (Improve note in the middle) ``` error[E0311]: the parameter type `T` may not live long enough --> src/main.rs:25:11 | 24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) { | -- help: consider adding an explicit lifetime bound...: `T: 'a +` 25 | scope.spawn(move |_| { | ^^^^^ | note: the parameter type `T` must be valid for the anonymous lifetime defined on the function body at 24:40... --> src/main.rs:24:40 | 24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) { | ^^^^^ note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds --> src/main.rs:25:11 | 25 | scope.spawn(move |_| { | ^^^^^ ``` r? ``````@estebank``````
2021-02-27Move test file, add test of generated linkLucas De Angelis-0/+3
2021-02-26Fix intra-doc handling of `Self` in enumLucas De Angelis-0/+8
Fixes #82209
2021-02-26Auto merge of #82552 - GuillaumeGomez:rollup-8dn1ztn, r=GuillaumeGomezbors-20/+84
Rollup of 8 pull requests Successful merges: - #81940 (Stabilize str_split_once) - #82165 (Reword labels on E0308 involving async fn return type) - #82456 (Replaced some unwrap_or and map_or with lazy variants) - #82491 (Consider inexpensive inlining criteria first) - #82506 (Properly account for non-shorthand pattern field in unused variable lint) - #82535 (Set codegen thread names) - #82545 (rustdoc: add optional woff2 versions of FiraSans.) - #82549 (Revert "Update normalize.css to 8.0.1") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-26Rollup merge of #82506 - estebank:unused_variable_lint, r=lcnrGuillaume Gomez-0/+46
Properly account for non-shorthand pattern field in unused variable lint Fix #82488
2021-02-26Rollup merge of #82165 - nellshamrell:nell/fix-80658-B, r=estebankGuillaume Gomez-20/+38
Reword labels on E0308 involving async fn return type Fix for #80658. When someone writes code like this: ```rust fn foo() -> u8 { async fn async_fn() -> () {} async_fn() } ``` And they try to compile it, they will see an error that looks like this: ```bash error[E0308]: mismatched types --> test.rs:4:5 | 1 | fn foo() -> u8 { | -- expected `u8` because of return type 2 | async fn async_fn() -> () {} | -- checked the `Output` of this `async fn`, found opaque type 3 | 4 | async_fn() | ^^^^^^^^^^ expected `u8`, found opaque type | = note: while checking the return type of this `async fn` = note: expected type `u8` found opaque type `impl Future` ```
2021-02-26Auto merge of #81458 - estebank:match-stmt-remove-semi, r=oli-obkbors-0/+81
Detect match statement intended to be tail expression CC #24157