summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-11-30tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.Eduard-Mihai Burtescu-2/+25
2018-11-30tests: move all proc_macro tests from -fulldeps.Eduard-Mihai Burtescu-0/+1511
2018-11-22Reword and fix testEsteban Küber-3/+1
2018-11-16adjust remaining testsRalf Jung-0/+2
2018-11-15Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakisbors-0/+32
Reattach all grandchildren when constructing specialization graph. Specialization graphs are constructed by incrementally adding impls in the order of declaration. If the impl being added has its specializations in the graph already, they should be reattached under the impl. However, the current implementation only reattaches the one found first. Therefore, in the following specialization graph, ``` Tr1 | I3 / \ I1 I2 ``` If `I1`, `I2`, and `I3` are declared in this order, the compiler mistakenly constructs the following graph: ``` Tr1 / \ I3 I2 | I1 ``` This patch fixes the reattach procedure to include all specializing grandchildren-to-be. Fixes #50452.
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-72/+0
Implement by-value object safety This PR implements **by-value object safety**, which is part of unsized rvalues #48055. That means, with `#![feature(unsized_locals)]`, you can call a method `fn foo(self, ...)` on trait objects. One aim of this is to enable `Box<FnOnce>` in the near future. The difficulty here is this: when constructing a vtable for a trait `Foo`, we can't just put the function `<T as Foo>::foo` into the table. If `T` is no larger than `usize`, `self` is usually passed directly. However, as the caller of the vtable doesn't know the concrete `Self` type, we want a variant of `<T as Foo>::foo` where `self` is always passed by reference. Therefore, when the compiler encounters such a method to be generated as a vtable entry, it produces a newly introduced instance called `InstanceDef::VtableShim(def_id)` (that wraps the original instance). the shim just derefs the receiver and calls the original method. We give different symbol names for the shims by appending `::{{vtable-shim}}` to the symbol path (and also adding vtable-shimness as an ingredient to the symbol hash). r? @eddyb
2018-10-25Rebase falloutOliver Schneider-2/+1
2018-10-25Report const eval error inside the queryOliver Schneider-3/+3
2018-10-24Move compile-fail/unsized-locals under ui as per #44844.Masaki Hara-102/+0
2018-10-24Add tests for unsized-locals.Masaki Hara-0/+30
2018-10-08Reattach all grandchildren when constructing specialization graph.Masaki Hara-0/+32
This commit fixes the issue #50452.
2018-10-05Stabilize `min_const_fn`Oliver Schneider-1/+0
2018-10-03Move platform dependent output ui tests to compile-failOliver Schneider-0/+48
2018-09-07stabilize `#[panic_handler]`Jorge Aparicio-2/+0
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+1
2018-08-23add #[panic_handler]; deprecate #[panic_implementation]Jorge Aparicio-6/+6
2018-08-19Lift some Sized checks.Masaki Hara-0/+72
2018-08-14Moved problematic tests on x86_64-gnu-nopt back to compile-fail.David Wood-0/+30
2018-08-14Moved problematic tests on x86_64-pc-windows-gnu back to compile-fail.David Wood-0/+122
2018-08-14Moved problematic tests on armhf-gnu back to compile-fail.David Wood-0/+41
2018-08-14Moved problematic tests on wasm32-unknown back to compile-fail.David Wood-0/+48
2018-08-14Moved problematic tests on dist-x86_64-musl back to compile-fail.David Wood-0/+105
2018-08-14Moved problematic tests on i586-unknown-linux-gnu back to compile-fail.David Wood-0/+14
2018-08-14Normalize tests for i686 Windows.David Wood-0/+65
2018-08-14Moved problematic tests on Windows back to compile-fail.David Wood-0/+117
2018-08-14Moved tests back to compile-test if they don't work on ui.David Wood-0/+91
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