about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-03-21Rollup merge of #70032 - lcnr:issue69970, r=varkorDylan DPC-0/+25
put type params in front of const params in generics_of fixes #69970 r? @varkor
2020-03-21Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfacklerDylan DPC-0/+48
Fix abort-on-eprintln during process shutdown This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-21Rollup merge of #69901 - RalfJung:rustc_layout, r=eddybDylan DPC-0/+334
add #[rustc_layout(debug)] @eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
2020-03-21Rollup merge of #69497 - Zoxc:ast-fragment-error, r=petrochenkovDylan DPC-2/+13
Don't unwind when hitting the macro expansion recursion limit This removes one use of `FatalError.raise()`. r? @petrochenkov
2020-03-21normalize away preferred alignmentRalf Jung-28/+13
2020-03-21Rollup merge of #70184 - Centril:include-mod-relativism, r=petrochenkovMazdak Farrokhzad-0/+13
expand_include: set `.directory` to dir of included file. Resolves the regression noted in https://github.com/rust-lang/rust/pull/69838/#discussion_r395217057. r? @petrochenkov cc @eddyb @Mark-Simulacrum
2020-03-21Rollup merge of #70176 - rylev:ice-tests, r=CentrilMazdak Farrokhzad-0/+651
Add tests for #58319 and #65131 Fixes #58319 and fixes #65131
2020-03-21Rollup merge of #70058 - Centril:fix-70050, r=petrochenkovMazdak Farrokhzad-1/+37
can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs. Make `can_begin_literal_or_bool` (renamed to `can_begin_literal_maybe_minus`) accept `NtLiteral(e) | NtExpr(e)` where `e` is either a literal or a negated literal. Fixes https://github.com/rust-lang/rust/issues/70050. r? @petrochenkov
2020-03-21Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJungMazdak Farrokhzad-0/+22
Remove the call that makes miri fail Fixes the concern raised in https://github.com/rust-lang/rust/pull/69645/files#r392884274 cc @RalfJung
2020-03-21Rollup merge of #69033 - jonas-schievink:resume-with-context, r=tmandryMazdak Farrokhzad-2/+15
Use generator resume arguments in the async/await lowering This removes the TLS requirement from async/await and enables it in `#![no_std]` crates. Closes https://github.com/rust-lang/rust/issues/56974 I'm not confident the HIR lowering is completely correct, there seem to be quite a few undocumented invariants in there. The `async-std` and tokio test suites are passing with these changes though.
2020-03-20Auto merge of #69509 - RalfJung:debug-assert-write, r=eddybbors-3/+4
debug-assert ptr sanity in ptr::write This is a re-submission of the parts that we removed from https://github.com/rust-lang/rust/pull/69208 due to ["interesting" test failures](https://github.com/rust-lang/rust/pull/69208#issuecomment-591310437). Fixes https://github.com/rust-lang/rust/issues/53871 r? @Mark-Simulacrum @eddyb
2020-03-20make rustc_layout also work for type definitionsRalf Jung-6/+228
2020-03-20expand_include: set `.directory` to dir of included file.Mazdak Farrokhzad-0/+13
2020-03-20add a test for rustc_layout(debug)Ralf Jung-0/+127
2020-03-20can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-1/+37
2020-03-20Fix abort-on-eprintln during process shutdownAlex Crichton-0/+48
This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-20Add tests for #58319 and #65131Ryan Levick-0/+651
2020-03-20Update const_forget.rsDutchGhost-1/+1
2020-03-20Rollup merge of #70131 - Aaron1011:fix/issue-55099-test, r=nikomatsakisYuki Okushi-0/+28
Add regression test for TAIT lifetime inference (issue #55099) Fixes #55099 The minimized reproducer in issue #55099 now compiles successfully. This commit adds a regression test for it.
2020-03-19sort generic param order in generics_ofBastian Kauschke-0/+25
2020-03-19Update testJohn Kåre Alsaker-2/+13
2020-03-19Rollup merge of #69959 - alexcrichton:fix-panic-in-print, r=Mark-SimulacrumMazdak Farrokhzad-0/+48
std: Don't abort process when printing panics in tests This commit fixes an issue when using `set_print` and friends, notably used by libtest, to avoid aborting the process if printing panics. This previously panicked due to borrowing a mutable `RefCell` twice, and this is worked around by borrowing these cells for less time, instead taking out and removing contents temporarily. Closes #69558
2020-03-19Add regression test for TAIT lifetime inference (issue #55099)Aaron Hill-0/+28
Fixes #55099 The minimized reproducer in issue #55099 now compiles successfully. This commit adds a regression test for it.
2020-03-18Properly handle Spans that reference imported SourceFilesAaron Hill-0/+44
Previously, metadata encoding used DUMMY_SP to represent any spans that referenced an 'imported' SourceFile - e.g. a SourceFile from an upstream dependency. These leads to sub-optimal error messages in certain cases (see the included test). This PR changes how we encode and decode spans in crate metadata. We encode spans in one of two ways: * 'Local' spans, which reference non-imported SourceFiles, are encoded exactly as before. * 'Foreign' spans, which reference imported SourceFiles, are encoded with the CrateNum of their 'originating' crate. Additionally, their 'lo' and 'high' values are rebased on top of the 'originating' crate, which allows them to be used with the SourceMap data encoded for that crate. The `ExternalSource` enum is renamed to `ExternalSourceKind`. There is now a struct called `ExternalSource`, which holds an `ExternalSourceKind` along with the original line number information for the file. This is used during `Span` serialization to rebase spans onto their 'owning' crate.
2020-03-18Move the const-forget test into ui testsDutchGhost-0/+22
2020-03-18Rollup merge of #70075 - GuillaumeGomez:fix-repr-display, r=petrochenkovMazdak Farrokhzad-12/+12
Fix repr pretty display Fixes #70027. r? @varkor
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-81/+81
Miri error reform Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does. ~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~ r? @oli-obk Fixes https://github.com/rust-lang/const-eval/issues/4
2020-03-18Rollup merge of #69838 - Centril:expand-module, r=petrochenkovMazdak Farrokhzad-35/+106
Expansion-driven outline module parsing After this PR, the parser will not do any conditional compilation or loading of external module files when `mod foo;` is encountered. Instead, the parser only leaves `mod foo;` in place in the AST, with no items filled in. Expansion later kicks in and will load the actual files and do the parsing. This entails that the following is now valid: ```rust #[cfg(FALSE)] mod foo { mod bar { mod baz; // `foo/bar/baz.rs` doesn't exist, but no error! } } ``` Fixes https://github.com/rust-lang/rust/issues/64197. r? @petrochenkov
2020-03-18Rollup merge of #69837 - jonas-schievink:gen-discr-opt, r=tmandryMazdak Farrokhzad-24/+158
Use smaller discriminants for generators Closes https://github.com/rust-lang/rust/issues/69815 I'm not yet sure about the runtime performance impact of this, so I'll try running this on some benchmarks (if I can find any). (Update: No impact on the benchmarks I've measured on) * [x] Add test with a generator that has exactly 256 total states * [x] Add test with a generator that has more than 256 states so that it needs to use a u16 discriminant * [x] Add tests for the size of `Option<[generator]>` * [x] Add tests for the `discriminant_value` intrinsic in all cases
2020-03-18Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakisMazdak Farrokhzad-41/+62
Erase regions in writeback Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`. cc #68261 r? @nikomatsakis
2020-03-18Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPCMazdak Farrokhzad-36/+52
clean up E0308 explanation r? @Dylan-DPC
2020-03-18--bless windows testMazdak Farrokhzad-5/+13
2020-03-18fix pre-expansion linting infraMazdak Farrokhzad-0/+20
2020-03-18tweak outline module parsing spansMazdak Farrokhzad-24/+29
2020-03-18add test for stripped nested outline moduleMazdak Farrokhzad-0/+13
2020-03-18de-fatalize outline module parsingMazdak Farrokhzad-6/+34
2020-03-18submod_path: use id.spanMazdak Farrokhzad-9/+6
2020-03-18std: Don't abort process when printing panics in testsAlex Crichton-0/+48
This commit fixes an issue when using `set_print` and friends, notably used by libtest, to avoid aborting the process if printing panics. This previously panicked due to borrowing a mutable `RefCell` twice, and this is worked around by borrowing these cells for less time, instead taking out and removing contents temporarily. Closes #69558
2020-03-18increase stack slack for x86_64-pc-windows-gnuRalf Jung-3/+4
2020-03-17Test that async/await compiles with `#![no_std]`Jonas Schievink-0/+13
2020-03-17Make async/await lowering use resume argumentsJonas Schievink-2/+2
2020-03-17Update pretty testsGuillaume Gomez-12/+12
2020-03-17Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisabors-0/+16
Don't use static crt by default when build proc-macro Don't check value of `crt-static` when build proc-macro crates, since they are always built dynamically. For more information, see https://github.com/rust-lang/cargo/issues/7563#issuecomment-591965320 I hope this will fix issues about compiling `proc_macro` crates on musl host without bring more issues. Fix https://github.com/rust-lang/cargo/issues/7563
2020-03-17Rollup merge of #69922 - RalfJung:less-intrinsic, r=oli-obkMazdak Farrokhzad-48/+11
implement zeroed and uninitialized with MaybeUninit This is the second attempt of doing such a change (first PR: https://github.com/rust-lang/rust/pull/62150). The last change [got reverted](https://github.com/rust-lang/rust/pull/63343) because it [caused](https://github.com/rust-lang/rust/issues/62825) some [issues](https://github.com/rust-lang/rust/issues/52898#issuecomment-512182438) in [code that incorrectly used these functions](https://github.com/erlepereira/x11-rs/issues/99). Since then, the [problematic code has been fixed](https://github.com/erlepereira/x11-rs/pull/101), and rustc [gained a lint](https://github.com/rust-lang/rust/pull/63346) that is able to detect many misuses of these functions statically and a [dynamic check that panics](https://github.com/rust-lang/rust/pull/66059) instead of causing UB for some incorrect uses. Fixes https://github.com/rust-lang/rust/issues/62825
2020-03-17Rollup merge of #68746 - matthewjasper:metahygiene, r=petrochenkovMazdak Farrokhzad-0/+53
Make macro metavars respect (non-)hygiene This makes them more consistent with other name resolution while not breaking any code on crater.
2020-03-17Update tests for erasing regions in typeckMatthew Jasper-41/+62
2020-03-17Rollup merge of #70000 - petrochenkov:rawkeypars, r=davidtwcoMazdak Farrokhzad-1/+23
resolve: Fix regression in resolution of raw keywords in paths Fixes https://github.com/rust-lang/rust/issues/63882.
2020-03-17Rollup merge of #69881 - Centril:fix-69485, r=oli-obkMazdak Farrokhzad-0/+18
VariantSizeDifferences: bail on SizeOverflow Fixes #69485. r? @oli-obk
2020-03-17Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasperMazdak Farrokhzad-0/+186
expand: Implement something similar to `#[cfg(accessible(path))]` cc https://github.com/rust-lang/rust/issues/64797 The feature is implemented as a `#[cfg_accessible(path)]` attribute macro rather than as `#[cfg(accessible(path))]` because it needs to wait until `path` becomes resolvable, and `cfg` cannot wait, but macros can wait. Later we can think about desugaring or not desugaring `#[cfg(accessible(path))]` into `#[cfg_accessible(path)]`. This implementation is also incomplete in the sense that it never returns "false" from `cfg_accessible(path)`, it requires some tweaks to resolve, which is not quite ready to answer queries like this during early resolution. However, the most important part of this PR is not `cfg_accessible` itself, but expansion infrastructure for retrying expansions. Before this PR we could say "we cannot resolve this macro path, let's try it later", with this PR we can say "we cannot expand this macro, let's try it later" as well. This is a pre-requisite for - turning `#[derive(...)]` into a regular attribute macro, - properly supporting eager expansion for macros that cannot yet be resolved like ``` fn main() { println!(not_available_yet!()); } macro_rules! make_available { () => { #[macro_export] macro_rules! not_available_yet { () => { "Hello world!" } }} } make_available!(); ```
2020-03-17Rollup merge of #69811 - petrochenkov:privdiag2, r=estebankMazdak Farrokhzad-6/+46
resolve: Print import chains on privacy errors A part of https://github.com/rust-lang/rust/pull/67951 that doesn't require hacks. r? @estebank