about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-08-14Moved compile-fail tests to ui tests.David Wood-61897/+0
2018-08-14rustc_resolve: fix special-case for one-segment import paths.Eduard-Mihai Burtescu-12/+12
2018-08-11Feature gate arbitrary tokens in non-macro attributes with a separate gateVadim Petrochenkov-19/+15
Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
2018-08-10Auto merge of #53131 - davidtwco:issue-52663-thread-local-static, r=nikomatsakisbors-1/+1
NLL says something "does not live long enough" when talking about a (thread-local) static Part of #52663. r? @nikomatsakis
2018-08-08Auto merge of #53053 - petrochenkov:custattr, r=alexcrichtonbors-9/+5
resolve: Support custom attributes when macro modularization is enabled Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute. Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`). Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it). The first two commits are preliminary cleanups/refactorings.
2018-08-07Add feature gate checksOliver Schneider-0/+2
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-2/+2
2018-08-07Special case error message for thread-local statics.David Wood-1/+1
2018-08-06Address review commentsVadim Petrochenkov-3/+3
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-08-06Enable macro modularization implicitly if one of "advanced" macro features ↵Vadim Petrochenkov-5/+1
is enabled Do not mark all builtin attributes as used when macro modularization is enabled
2018-08-06Support custom attributes when macro modularization is enabledVadim Petrochenkov-1/+1
2018-08-06Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakisbors-2/+2
Disable some nice region errors in NLL mode. Fixes #52739. cc #52742. r? @nikomatsakis
2018-08-06Disable some nice region errors in NLL mode.David Wood-2/+2
2018-08-06Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboatsbors-226/+227
Add errors for unknown, stable and duplicate feature attributes - Adds an error for unknown (lang and lib) features. - Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features). - Adds an error for duplicate (lang and lib) features. ```rust #![feature(fake_feature)] //~ ERROR unknown feature `fake_feature` #![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0 #![feature(non_exhaustive)] #![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute ``` Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features). There are a few outstanding problems, that I haven't narrowed down yet: - [x] Stability attributes on macros do not seem to be taken into account. - [x] Stability attributes behind `cfg` attributes are not taken into account. - [x] There are failing incremental tests.
2018-08-06Auto merge of #52332 - ↵bors-3/+3
zackmdavis:dead_code_lint_should_say_2_electric_boogaloo, r=pnkfelix dead-code lint: say "constructed" for structs Respectively. This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been reported (more than once—at least #19140, #44083, and #44565) that the "never used" language was confusing for enum variants that were "used" as match patterns, so the wording was changed to say never "constructed" specifically for enum variants. More recently, the same issue was raised for structs (#52325). It seems consistent to say "constructed" here, too, for the same reasons. ~~While we're here, we can also use more specific word "called" for unused functions and methods. (We declined to do this in #46103, but the rationale given in the commit message doesn't actually make sense.)~~ This resolves #52325.
2018-08-05Fix 2018 edition testsvarkor-9/+0
2018-08-05Fix run-pass-fulldeps testsvarkor-1/+1
2018-08-05Convert unknown_features lint into an errorvarkor-3/+5
2018-08-05Fix test/compile-failvarkor-213/+221
2018-08-03Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJungbors-1/+1
Reintroduce `Undef` and properly check constant value sizes r? @RalfJung cc @eddyb basically all kinds of silent failures that never occurred are assertions now
2018-08-02Auto merge of #52841 - petrochenkov:premacro, r=alexcrichtonbors-37/+2
resolve: Implement prelude search for macro paths, implement tool attributes When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment in `fn resolve_lexical_macro_path_segment` for more details. "Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude. This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope. The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order. If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway). Fixes https://github.com/rust-lang/rust/issues/52576 Fixes https://github.com/rust-lang/rust/issues/52512 Fixes https://github.com/rust-lang/rust/issues/51277 cc https://github.com/rust-lang/rust/issues/52269
2018-08-02Second field of ScalarPair can be undef in some casesOliver Schneider-1/+1
2018-08-01Rollup merge of #52930 - eddyb:issue-52489, r=cramertjPietro Albini-0/+30
rustc_resolve: record single-segment extern crate import resolutions. Fixes #52489 by recording special-cased single-segment imports for later (e.g. stability) checks. cc @alexcrichton @Mark-Simulacrum @petrochenkov Does this need to be backported?
2018-08-01resolve: Implement prelude search for macro pathsVadim Petrochenkov-37/+2
resolve/expansion: Implement tool attributes
2018-08-01rustc_resolve: record single-segment extern crate import resolutions.Eduard-Mihai Burtescu-0/+30
2018-07-31rustc: Handle linker diagnostic from LLVMAlex Crichton-0/+52
Previously linker diagnostic were being hidden when two modules were linked together but failed to link. This commit fixes the situation by ensuring that we have a diagnostic handler installed and also adds support for handling linker diagnostics.
2018-07-29resolved upstream merge conflictsBrad Gibson-13534/+1053
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-0/+89
2018-07-29Sanity-check all constantsOliver Schneider-2/+1
2018-07-28Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelixbors-0/+42
do not overwrite child def-id in place but rather remove/insert When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later. Fixes #52050 r? @aturon -- do you still remember this code at all? :)
2018-07-26Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-67/+0
Rollup of 16 pull requests Successful merges: - #52558 (Add tests for ICEs which no longer repro) - #52610 (Clarify what a task is) - #52617 (Don't match on region kinds when reporting NLL errors) - #52635 (Fix #[linkage] propagation though generic functions) - #52647 (Suggest to take and ignore args while closure args count mismatching) - #52649 (Point spans to inner elements of format strings) - #52654 (Format linker args in a way that works for gcc and ld) - #52667 (update the stdsimd submodule) - #52674 (Impl Executor for Box<E: Executor>) - #52690 (ARM: expose `rclass` and `dsp` target features) - #52692 (Improve readability in a few sorts) - #52695 (Hide some lints which are not quite right the way they are reported to the user) - #52718 (State default capacity for BufReader/BufWriter) - #52721 (std::ops::Try impl for std::task::Poll) - #52723 (rustc: Register crates under their real names) - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)) Failed merges: - #52678 ([NLL] Use better spans in some errors) r? @ghost
2018-07-26move mir_check_* to ui tests, add adjusted referencesNiko Matsakis-120/+0
2018-07-22Point at internal span in format stringEsteban Küber-67/+0
2018-07-21dead-code lint: say "constructed" for structsZack M. Davis-3/+3
This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been reported (more than once—at least #19140, #44083, and #44565) that the "never used" language was confusing for enum variants that were "used" as match patterns, so the wording was changed to say never "constructed" specifically for enum variants. More recently, the same issue was raised for structs (#52325). It seems consistent to say "constructed" here, too, for the same reasons. We considered using more specific word "called" for unused functions and methods (while we declined to do this in #46103, the rationale given in the commit message doesn't actually make sense), but it turns out that Cargo's test suite expects the "never used" message, and maybe we don't care enough even to make a Cargo PR over such a petty and subjective wording change. This resolves #52325.
2018-07-21do not overwrite child def-id in place but rather remove/insertNiko Matsakis-0/+42
When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.
2018-07-20Update tests for new NLL mutability errorsMatthew Jasper-5/+5
2018-07-17Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obkbors-12817/+4
Move some `compile-fail` tests to `ui` Re: #44844.
2018-07-16Return tests that have platform dependant outputEsteban Küber-0/+102
2018-07-16ExprKindcsmoe-1/+1
2018-07-15Fix testsEsteban Küber-0/+106
2018-07-15Move some `compile-fail` tests to `ui`Esteban Küber-13021/+0
2018-07-14structured suggestion for renamed-and-removed-lintsZack M. Davis-4/+4
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-11Rollup merge of #52207 - RalfJung:unsafety-errors, r=estebankMark Rousskov-71/+28
improve error message shown for unsafe operations Add a short explanation saying why undefined behavior could arise. In particular, the error many people got for "creating a pointer to a packed field requires unsafe block" was not worded great -- it lead to people just adding the unsafe block without considering if what they are doing follows the rules. I am not sure if a "note" is the right thing, but that was the easiest thing to add... Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
2018-07-11Rollup merge of #52231 - lqd:error_mesg, r=GuillaumeGomezGuillaume Gomez-79/+79
Fix typo in error message E0277 Fix a typo we stumbled upon by accident :) r? @estebank
2018-07-11Auto merge of #52232 - arielb1:ill-adjusted-tuples, r=pnkfelixbors-0/+24
use the adjusted type for cat_pattern in tuple patterns This looks like a typo introduced in #51686. Fixes #52213. r? @pnkfelix beta + stable nominating because regression + unsoundness.
2018-07-11add test for #52213Ariel Ben-Yehuda-0/+24
2018-07-10Fix typo in error message E0277Rémy Rakic-79/+79
2018-07-10Auto merge of #52191 - SimonSapin:alloc_error_handler, r=alexcrichtonbors-0/+101
Implement #[alloc_error_handler] This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the `alloc` crate without the `std` crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.