about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-07-19Auto merge of #52197 - euclio:exit-code, r=oli-obkbors-0/+56
overhaul exit codes for rustc and rustdoc This commit changes the exit status of rustc to 1 in the presence of compilation errors. In the event of an unexpected panic (ICE) the standard panic error exit status of 101 remains. A run-make test is added to ensure that the exit code does not regress, and compiletest is updated to check for an exit status of 1 or 101, depending on the mode and suite. This is a breaking change for custom drivers. Note that while changes were made to the rustdoc binary, there is no intended behavior change. rustdoc errors (i.e., failed lints) will still report 101. While this could *also* hide potential ICEs, I will leave that work to a future PR. Fixes #51971.
2018-07-19Auto merge of #52486 - kennytm:rollup, r=kennytmbors-4/+39
Rollup of 13 pull requests Successful merges: - #51628 (use checked write in `LineWriter` example) - #52116 (Handle array manually in str case conversion methods) - #52218 (Amend option.take examples) - #52418 (Do not use desugared ident when suggesting adding a type) - #52439 (Revert some changes from #51917 to fix custom libdir) - #52455 (Fix doc comment: use `?` instead of `.unwrap()`) - #52458 (rustc: Fix a suggestion for the `proc_macro` feature) - #52464 (Allow clippy to be installed with make install) - #52472 (rustc: Enable `use_extern_macros` in 2018 edition) - #52477 (Clarify short-circuiting behvaior of Iterator::zip.) - #52480 (Cleanup #24958) - #52487 (Don't build twice the sanitizers on Linux) - #52510 (rustdoc: remove FIXME about macro redirects) Failed merges: r? @ghost
2018-07-19Rollup merge of #52418 - estebank:desugaring-type, r=nikomatsakiskennytm-1/+39
Do not use desugared ident when suggesting adding a type Re #51116.
2018-07-18Update test outputEsteban Küber-1/+1
2018-07-18Change label span to point at iterator instead of iter itemEsteban Küber-4/+4
2018-07-18Do not use desugared ident when suggesting adding a typeEsteban Küber-0/+38
2018-07-18Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearthbors-23/+336
Lint `async` identifiers in 2018 preparation mode r? @Manishearth fixes https://github.com/rust-lang/rust/issues/49716
2018-07-18Remove workarounds for #24958ljedrz-3/+0
2018-07-18Make `async_idents` allow-by-defaultOliver Schneider-17/+23
2018-07-18rustc: distinguish compilation failure from ICEAndy Russell-0/+56
This commit changes the exit status of rustc to 1 in the presence of compilation errors. In the event of an unexpected panic (ICE) the standard panic error exit status of 101 remains. A run-make test is added to ensure that the exit code does not regress, and compiletest is updated to check for an exit status of 1 or 101, depending on the mode and suite. This is a breaking change for custom drivers. Fixes #51971.
2018-07-18Auto merge of #52353 - alexcrichton:wasm-custom-section, r=eddybbors-163/+38
rustc: Use link_section, not wasm_custom_section This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-17Make `async_idents` an edition incompat lintOliver Schneider-15/+231
2018-07-17Auto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomezbors-62/+62
Fix doc link Result of first searching via: find src -type f -exec fgrep -l dynamically-sized-types--sized {} \; and then replacing all relevant occurrences via: find src/{libcore,test/ui} -type f -exec sed -i.bak \ s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \; find src -type f -name '*.bak' -exec rm {} \; (Note: Commands run on macOS 10.13 (BSD). `sed -i.bak` should work on GNU/Linux as well, but not tested.) EDIT: Did not compile / test Rust for this change at all. Clickable links for comparison: https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken) https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)
2018-07-17Fix doc linkFelix Rabe-62/+62
The link for comparison: - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken) - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed) This commit is the result of (first) searching via: find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized and then replacing all relevant occurrences via: find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \ s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm (Note: Commands run on macOS 10.13 (BSD). `sed -i.bak` should work on GNU/Linux as well, but not tested.)
2018-07-17Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, ↵kennytm-0/+24
r=QuietMisdreavus Pass edition flags to compiler from rustdoc as expected Fixes #52357.
2018-07-17Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obkbors-17/+9577
Move some `compile-fail` tests to `ui` Re: #44844.
2018-07-16Return tests that have platform dependant outputEsteban Küber-59/+0
2018-07-16Auto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkovbors-129/+93
rustc: Stabilize the `proc_macro` feature This commit stabilizes some of the `proc_macro` language feature as well as a number of APIs in the `proc_macro` crate as [previously discussed][1]. This means that on stable Rust you can now define custom procedural macros which operate as attributes attached to items or `macro_rules!`-like bang-style invocations. This extends the suite of currently stable procedural macros, custom derives, with custom attributes and custom bang macros. Note though that despite the stabilization in this commit procedural macros are still not usable on stable Rust. To stabilize that we'll need to stabilize at least part of the `use_extern_macros` feature. Currently you can define a procedural macro attribute but you can't import it to call it! A summary of the changes made in this PR (as well as the various consequences) is: * The `proc_macro` language and library features are now stable. * Other APIs not stabilized in the `proc_macro` crate are now named under a different feature, such as `proc_macro_diagnostic` or `proc_macro_span`. * A few checks in resolution for `proc_macro` being enabled have switched over to `use_extern_macros` being enabled. This means that code using `#![feature(proc_macro)]` today will likely need to move to `#![feature(use_extern_macros)]`. It's intended that this PR, once landed, will be followed up with an attempt to stabilize a small slice of `use_extern_macros` just for procedural macros to make this feature 100% usable on stable. [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-16rustc: Use link_section, not wasm_custom_sectionAlex Crichton-163/+38
This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-16rustc: Stabilize much of the `proc_macro` featureAlex Crichton-129/+93
This commit stabilizes some of the `proc_macro` language feature as well as a number of APIs in the `proc_macro` crate as [previously discussed][1]. This means that on stable Rust you can now define custom procedural macros which operate as attributes attached to items or `macro_rules!`-like bang-style invocations. This extends the suite of currently stable procedural macros, custom derives, with custom attributes and custom bang macros. Note though that despite the stabilization in this commit procedural macros are still not usable on stable Rust. To stabilize that we'll need to stabilize at least part of the `use_extern_macros` feature. Currently you can define a procedural macro attribute but you can't import it to call it! A summary of the changes made in this PR (as well as the various consequences) is: * The `proc_macro` language and library features are now stable. * Other APIs not stabilized in the `proc_macro` crate are now named under a different feature, such as `proc_macro_diagnostic` or `proc_macro_span`. * A few checks in resolution for `proc_macro` being enabled have switched over to `use_extern_macros` being enabled. This means that code using `#![feature(proc_macro)]` today will likely need to move to `#![feature(use_extern_macros)]`. It's intended that this PR, once landed, will be followed up with an attempt to stabilize a small slice of `use_extern_macros` just for procedural macros to make this feature 100% usable on stable. [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-16ExprKindcsmoe-1/+1
2018-07-16Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obkbors-36/+36
Revert #52266 Reverts #52266 until the performance issues with that PR are ironed out.
2018-07-16Auto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebankbors-4/+4
structured suggestion for renamed-and-removed-lints ![lint_renamed](https://user-images.githubusercontent.com/1076988/42730470-f74688dc-87a9-11e8-8dfd-b3e1d70b0af8.png) r? @estebank
2018-07-16Revert "Clean up CodegenUnit name generation."Michael Woerister-1/+1
This reverts commit 2c5cd9ce53d2d25041db0cb02b40ba460ffa8908.
2018-07-16Revert "Adapt codegen-unit tests to new CGU naming scheme."Michael Woerister-30/+30
This reverts commit 94b32adb71a75a3f5b53a39c52c62c2ce1a7cc56.
2018-07-16Revert "Fix some run-make tests after object file naming has changed."Michael Woerister-5/+5
This reverts commit dd3f445ed264ffc09ea42bd8d89853242e3a26f4.
2018-07-15Fix testsEsteban Küber-32/+0
2018-07-15Move some `compile-fail` tests to `ui`Esteban Küber-17/+9668
2018-07-15Auto merge of #52400 - RalfJung:match, r=oli-obkbors-0/+52
CTFE: use binary_op to compare integer with match disriminant This is needed to unblock https://github.com/solson/miri/pull/401: There is code in the Windows initialization functions that uses `match` to test whether a pointer is NULL. I will add a testcase in miri; I was not sure where to add a testcase in Rust itself. r? @oli-obk
2018-07-15Auto merge of #52383 - petrochenkov:pmns, r=alexcrichtonbors-1/+207
resolve: Functions introducing procedural macros reserve a slot in the macro namespace as well Similarly to https://github.com/rust-lang/rust/pull/52234, this gives us symmetry between internal and external views of a crate, but in this case it's always an error to call a procedural macro in the same crate in which it's defined. Closes https://github.com/rust-lang/rust/issues/52225
2018-07-15fix line numbersRalf Jung-3/+3
2018-07-15add license textRalf Jung-0/+10
2018-07-15add test caseRalf Jung-0/+42
2018-07-15Auto merge of #52361 - QuietMisdreavus:proc-macro-doc, r=ollie27bors-0/+18
rustdoc: don't panic when the cross-re-export handler sees a proc-macro When i moved the macro cross-re-export inlining code into `clean::inline`, i thought that if a macro had a `Def` that said it was a bang macro, it wouldn't be a proc macro. I thought wrong. Turns out, the `quote!()` in `libproc_macro` is actually a proc-macro, and when the `quote!()` macro is re-exported, this proc-macro is accessed in its place. This causes any `proc_macro::*` glob re-export to pull in this proc-macro, causing the assertion i added to fire, leading to an ICE. This replaces that with an Option that ignores proc-macros for the time being. Fixes https://github.com/rust-lang/rust/issues/52129
2018-07-14structured suggestion for renamed-and-removed-lintsZack M. Davis-4/+4
2018-07-15Auto merge of #52348 - oli-obk:bugfix, r=petrochenkovbors-1/+40
Reach the body of functions returning `impl Trait` but don't treat it as public fixes #52128 r? @pnkfelix cc @eddyb
2018-07-14Auto merge of #52318 - TheDarkula:master, r=oli-obkbors-0/+17
Removed the promotable field from CheckCrateVisitor... and replaced it with the custom enum Promotability. r? @oli-obk
2018-07-14Removed the promotable field from CheckCrateVisitor and replaced it with the ↵Meade Kincke-0/+17
structs Promotable and NotPromotable.
2018-07-14Auto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkovbors-0/+24
rustc: Tweak expansion of #[proc_macro] for 2018 The syntactical expansion of `#[proc_macro]` and related attributes currently contains absolute paths which conflicts with a lint for the 2018 edition, causing issues like #52214. This commit puts a band-aid on the issue by ensuring that procedural macros can also migrate to the 2018 edition for now by tweaking the expansion based on what features are activated. A more long-term solution would probably tweak the edition hygiene of spans, but this should do the trick for now. Closes #52214
2018-07-14Pass edition flags to compiler from rustdoc as expectedGuillaume Gomez-0/+24
2018-07-14Lint the use of async as an identifierOliver Schneider-23/+114
2018-07-14Functions introducing procedural macros reserve a slot in the macro ↵Vadim Petrochenkov-1/+207
namespace as well
2018-07-14Remove some tests using AST comparisons, fix other testsVadim Petrochenkov-59/+0
2018-07-14Auto merge of #52244 - glandium:issue52097, r=estebankbors-0/+518
Don't display default generic parameters in diagnostics that compare types In errors like: ``` expected type: `RawVec<foo, Global>` found type: `foo` ``` `RawVec` being defined as `RawVec<T, A: Alloc = Global>`, the error is better written as ``` expected type: `RawVec<foo>` found type: `foo` ``` In fact, that is already what happens when `foo` is not an ADT, because in that case, the diagnostic handler doesn't try to highlight something, and just uses the `Display` trait instead of its own logic. e.g. ``` expected type: `RawVec<usize>` found type: `usize` ```
2018-07-14Auto merge of #52328 - petrochenkov:pmroot, r=alexcrichtonbors-0/+33
proc_macro: Fix crate root detection Fixes https://github.com/rust-lang/rust/issues/52270
2018-07-13add test for issue 52129QuietMisdreavus-0/+18
2018-07-14Auto merge of #52314 - varkor:issue-52023, r=oli-obkbors-0/+22
Fix ICE when using a pointer cast as array size Fixes #52023. I'm not sure if the comment https://github.com/rust-lang/rust/issues/52023#issuecomment-402402392 suggested we also emit `E0080`, but just emitting `E0018` seems reasonable for now. r? @oli-obk
2018-07-14Auto merge of #52032 - DiamondLovesYou:amdgpu-kernel-abi, r=alexcrichtonbors-59/+123
Add the `amdgpu-kernel` ABI. Technically, there are requirements imposed by the LLVM `AMDGPUTargetMachine` on functions with this ABI (eg, the return type must be void), but I'm unsure exactly where this should be enforced.
2018-07-13Add the `amdgpu-kernel` ABI.Richard Diamond-59/+123
Technically, there are requirements imposed by the LLVM `AMDGPUTargetMachine` on functions with this ABI (eg, the return type must be void), but I'm unsure exactly where this should be enforced.
2018-07-13Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, ↵bors-36/+36
r=alexcrichton Preliminary work for incremental ThinLTO. Since implementing incremental ThinLTO is a bit more involved than I initially thought, I'm splitting out some of the things that already work. This PR (1) adds a way accessing some ThinLTO information in `rustc` and (2) does some cleanup around CGU/object file naming (which makes things quite a bit nicer). This is probably best reviewed one commit at a time.