about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2019-01-17Use structured suggestion to surround struct literal with parenthesisEsteban Küber-3/+9
2019-01-17fix compat-mode ui testMark Mansi-1/+1
2019-01-17Update testsMark Mansi-93/+88
2019-01-18Fix suggestions given mulitple bad lifetimesDan Robertson-2/+58
When given multiple lifetimes prior to type parameters in generic parameters, do not ICE and print the correct suggestion.
2019-01-18privacy: Account for associated existential typesVadim Petrochenkov-6/+33
2019-01-18Fix testsYuki Okushi-11/+67
2019-01-17Add signed num::NonZeroI* typesSimon Sapin-2/+2
Multiple people have asked for them, in https://github.com/rust-lang/rust/issues/49137. Given that the unsigned ones already exist, they are very easy to add and not an additional maintenance burden.
2019-01-17Deny the `overflowing_literals` lint for all editionsOliver Middleton-17/+30
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-14/+4
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-17Add test for linking non-existent static libraryAB1908-0/+13
2019-01-16Fix error templateAB1908-1/+1
2019-01-16Prioritize variants as inherent associated items during name resolutionVadim Petrochenkov-0/+89
2019-01-16Don't explicitly increment the depth for new trait predicatesAaron Hill-3/+70
2019-01-16Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakisbors-1199/+1065
Implement basic input validation for built-in attributes Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax"). For some subset of attributes (found by crater run), errors are lowered to deprecation warnings. NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-16With this change, I am able to build and test cross-platform `rustc`Felix S. Klock II-5/+3
In particular, I can use the following in my `config.toml`: ``` [build] host = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] target = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] ``` Before this change, my attempt to run the test suite would fail because the error output differs depending on what your host and targets are. ---- To be concrete, here are the actual messages one can observe: ``` % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=x86_64-unknown-linux-gnu error: the type `std::option::Option<[u32; 35184372088831]>` is too big for the current architecture error: aborting due to previous error % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=i686-unknown-linux-gnu error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture error: aborting due to previous error % ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=i686-unknown-linux-gnu error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture error: aborting due to previous error % ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=x86_64-unknown-linux-gnu error: the type `[u32; 35184372088831]` is too big for the current architecture error: aborting due to previous error ``` To address these variations, I changed the test to be more aggressive in its normalization strategy. We cannot (and IMO should not) guarantee that `Option` will appear in the error output here. So I normalized both types `Option<[u32; N]>` and `[u32; N]` to just `TYPE`
2019-01-16Auto merge of #57416 - alexcrichton:remove-platform-intrinsics, r=nagisabors-339/+0
rustc: Remove platform intrinsics crate This was originally attempted in #57048 but it was realized that we could fully remove the crate via the `"unadjusted"` ABI on intrinsics. This means that all intrinsics in stdsimd are implemented directly against LLVM rather than using the abstraction layer provided here. That ends up meaning that this crate is no longer used at all. This crate developed long ago to implement the SIMD intrinsics, but we didn't end up using it in the long run. In that case let's remove it!
2019-01-16Remove trailing whitespaceAB1908-1/+0
2019-01-16Add regression test to close #53787AB1908-0/+33
2019-01-16Fix testsYuki Okushi-24/+2
2019-01-15update test outputmark-12/+60
2019-01-15update/add testsmark-8/+183
2019-01-15use structured macro and path resolve suggestionsAndy Russell-15/+25
2019-01-15Rollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichtonMazdak Farrokhzad-0/+1
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
2019-01-15Rollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obkMazdak Farrokhzad-0/+30
Implement `check_attribute` to forbid `#[allow_internal_unsafe]` Fixes #56768. r? @oli-obk
2019-01-15Rollup merge of #57352 - arielb1:no-manual-markers, r=nikomatsakisMazdak Farrokhzad-0/+132
forbid manually impl'ing one of an object type's marker traits This shouldn't break compatibility for crates that do not use `feature(optin_builtin_traits)`, because as the test shows, it is only possible to impl a marker trait for a trait object in the crate the marker trait is defined in, which must define `feature(optin_builtin_traits)`. Fixes #56934. r? @nikomatsakis
2019-01-15Fix testsYuki Okushi-32/+11
2019-01-14stabilize extern_crate_selfRyan Leckey-20/+46
2019-01-15fix test output changing in rebaseAriel Ben-Yehuda-2/+2
2019-01-15Add error checkYuki Okushi-9/+30
2019-01-15Add testYuki Okushi-0/+30
2019-01-14Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkovMazdak Farrokhzad-6/+78
Recover from item trailing semicolon CC https://github.com/rust-lang/rfcs/pull/2479 r? @petrochenkov
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-113/+48
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-14Rollup merge of #57540 - estebank:eval-more, r=petrochenkovMazdak Farrokhzad-110/+222
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC #48724.
2019-01-14Rollup merge of #57481 - euclio:bool-cast-suggestion, r=estebankMazdak Farrokhzad-20/+25
provide suggestion for invalid boolean cast Also, don't suggest comparing to zero for non-numeric expressions.
2019-01-14rustc: Remove platform intrinsics crateAlex Crichton-339/+0
This was originally attempted in #57048 but it was realized that we could fully remove the crate via the `"unadjusted"` ABI on intrinsics. This means that all intrinsics in stdsimd are implemented directly against LLVM rather than using the abstraction layer provided here. That ends up meaning that this crate is no longer used at all. This crate developed long ago to implement the SIMD intrinsics, but we didn't end up using it in the long run. In that case let's remove it!
2019-01-14Add a regression test for mutating a non-mut #[thread_local]Michael Bradshaw-0/+36
2019-01-14Auto merge of #57592 - Centril:rollup, r=Centrilbors-152/+193
Rollup of 6 pull requests Successful merges: - #57232 (Parallelize and optimize parts of HIR map creation) - #57418 (MetadataOnlyCodegenBackend: run the collector only once) - #57465 (Stabilize cfg_target_vendor) - #57477 (clarify resolve typo suggestion) - #57556 (privacy: Fix private-in-public check for existential types) - #57584 (Remove the `connect_timeout_unroutable` test.) Failed merges: r? @ghost
2019-01-14Rollup merge of #57556 - petrochenkov:privexist, r=arielb1Mazdak Farrokhzad-0/+15
privacy: Fix private-in-public check for existential types Fixes https://github.com/rust-lang/rust/issues/53546 (regression from https://github.com/rust-lang/rust/pull/56878) r? @arielb1
2019-01-14Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavisMazdak Farrokhzad-106/+178
clarify resolve typo suggestion Include the kind of the binding that we're suggesting, and use a structured suggestion. Fixes #53445.
2019-01-14Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, ↵Mazdak Farrokhzad-46/+0
r=joshtriplett,Centril Stabilize cfg_target_vendor This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates. This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0. The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs). Closes #29718
2019-01-14Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapinbors-2/+0
Stabilize core::convert::identity r? @SimonSapin fixes https://github.com/rust-lang/rust/issues/53500 This is waiting for FCP to complete but in the interim it would be good to review.
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-46/+0
2019-01-14Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obkbors-245/+322
Use structured suggestions for nonstandard style lints This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered. Fixes #48103. Fixes #52414.
2019-01-14Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice testAaron Hill-0/+1
This ensures that the test passes, regardless of what the user has set RUST_BACKTRACE to.
2019-01-13Suggest removal of semicolon when appropriateEsteban Küber-23/+73
2019-01-13Tweak output of type mismatch between "then" and `else` `if` armsEsteban Küber-7/+139
2019-01-13Recover from item trailing semicolonEsteban Küber-6/+78
2019-01-13Auto merge of #57580 - Centril:rollup, r=Centrilbors-1/+96
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2019-01-13Rollup merge of #57538 - dlrobertson:fix_57472, r=zackmdavisMazdak Farrokhzad-0/+55
librustc_mir: Fix ICE with slice patterns If a match arm does not include all fields in a structure and a later pattern includes a field that is an array, we will attempt to use the array type from the prior arm. When calculating the field type, treat a array of an unknown size as a `TyErr`. Fixes: #57472
2019-01-13Rollup merge of #57366 - estebank:point-match-discrim, r=varkorMazdak Farrokhzad-1/+41
Point at match discriminant on type error in match arm pattern ``` error[E0308]: mismatched types --> src/main.rs:5:9 | 4 | let temp: usize = match a + b { | ----- this expression has type `usize` 5 | Ok(num) => num, | ^^^^^^^ expected usize, found enum `std::result::Result` | = note: expected type `usize` found type `std::result::Result<_, _>` ``` Fix #57279.