about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-01-25process trait/impl items directly from the visitor callbackNiko Matsakis-0/+25
The current setup processes impl/trait items while visiting the impl/trait. This means we basically have this setup: <Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3}) But this was largely an artifact of the older code. By moving the processing of items into method dedicated for their use, we produce this setup: <Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0) ... <Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3)
2017-01-25Hide uninhabitedness checks behind feature gateAndrew Cann-19/+50
2017-01-25Auto merge of #35712 - oli-obk:exclusive_range_patterns, r=nikomatsakisbors-0/+78
exclusive range patterns adds `..` patterns to the language under a feature gate (`exclusive_range_pattern`). This allows turning ``` rust match i { 0...9 => {}, 10...19 => {}, 20...29 => {}, _ => {} } ``` into ``` rust match i { 0..10 => {}, 10..20 => {}, 20..30 => {}, _ => {} } ```
2017-01-25end temporary lifetimes being extended by `let X: &_` hintsAriel Ben-Yehuda-0/+27
Fixes #36082.
2017-01-25Stabilize Self and associated types in struct expressions and patternsVadim Petrochenkov-37/+0
2017-01-24Remove Reflectest31-127/+0
* Remove the Reflect trait * Remove the "reflect" lang feature
2017-01-24Improve some expected/found error messages from parserVadim Petrochenkov-7/+10
2017-01-24Add testsVadim Petrochenkov-0/+54
2017-01-24Refactor parsing of generic arguments/parameters and where clausesVadim Petrochenkov-15/+32
2017-01-22[Gate Tests] - marking feature testsColm Seale-0/+11
Removal of the lang feature gate tests whitelist #39059 r? @est31
2017-01-22Auto merge of #39127 - canndrew:unreachable-pattern-errors-into-warnings, ↵bors-0/+96
r=arielb1 Change unreachable pattern ICEs to warnings Allow code with unreachable `?` and `for` patterns to compile. Add some tests.
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-2/+21
2017-01-21Resolve `Self` in impl headersVadim Petrochenkov-0/+43
2017-01-21Improve `unused_extern_crate` warnings.Jeffrey Seyfried-0/+5
2017-01-20Test fixes from the rollupAlex Crichton-0/+2
2017-01-20Rollup merge of #39195 - nagisa:deny-extra-requirement-in-impl, r=eddybAlex Crichton-2/+0
Deny extra_requirement_in_impl forward-compat lint Part of #37166
2017-01-20Rollup merge of #39143 - nikomatsakis:issue-38967, r=eddybAlex Crichton-0/+17
check inherent impls of traits for overlap as well Simple oversight. Fixes #38967. r? @eddyb
2017-01-20Rollup merge of #39120 - alexcrichton:emscripten-tests, r=brsonAlex Crichton-0/+14
travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-20Rollup merge of #39077 - jseyfried:crate_var_imports, r=nrcAlex Crichton-3/+10
Improve the warning cycle for `use $crate;` Fixes #39049. r? @nrc
2017-01-20Rollup merge of #38842 - abonander:proc_macro_attribute, r=jseyfriedAlex Crichton-0/+5
Implement `#[proc_macro_attribute]` This implements `#[proc_macro_attribute]` as described in https://github.com/rust-lang/rfcs/pull/1566 The following major (hopefully non-breaking) changes are included: * Refactor `proc_macro::TokenStream` to use `syntax::tokenstream::TokenStream`. * `proc_macro::tokenstream::TokenStream` no longer emits newlines between items, this can be trivially restored if desired * `proc_macro::TokenStream::from_str` does not try to parse an item anymore, moved to `impl MultiItemModifier for CustomDerive` with more informative error message * Implement `#[proc_macro_attribute]`, which expects functions of the kind `fn(TokenStream, TokenStream) -> TokenStream` * Reactivated `#![feature(proc_macro)]` and gated `#[proc_macro_attribute]` under it * `#![feature(proc_macro)]` and `#![feature(custom_attribute)]` are mutually exclusive * adding `#![feature(proc_macro)]` makes the expansion pass assume that any attributes that are not built-in, or introduced by existing syntax extensions, are proc-macro attributes * Fix `feature_gate::find_lang_feature_issue()` to not use `unwrap()` * This change wasn't necessary for this PR, but it helped debugging a problem where I was using the wrong feature string. * Move "completed feature gate checking" pass to after "name resolution" pass * This was necessary for proper feature-gating of `#[proc_macro_attribute]` invocations when the `proc_macro` feature flag isn't set. Prototype/Litmus Test: [Implementation](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/src/lib.rs#L13) -- [Usage](https://github.com/abonander/anterofit/blob/proc_macro/service-attr/examples/post_service.rs#L35)
2017-01-21Add unreachable attribute to Err branchAndrew Cann-0/+20
2017-01-20Remove attribute on matchAndrew Cann-0/+30
2017-01-20Auto merge of #38955 - estebank:highlighted-diags, r=nikomatsakisbors-156/+0
Teach Diagnostics to highlight text Support styled `Diagnostic` output: <img width="469" alt="mismatched types error with colorized types in the note" src="https://cloud.githubusercontent.com/assets/1606434/21871227/93a84198-d815-11e6-88b1-0ede3c7e28ef.png"> Closes #37532 and #38901. r? @nikomatsakis CC @jonathandturner @nagisa @nrc
2017-01-20Auto merge of #38603 - arielb1:supertrait-self-3, r=nikomatsakisbors-0/+42
traits with self-containing supertraits are not object safe This should be the last time I fix this function. Fixes #38404.
2017-01-20Deny extra_requirement_in_impl forward-compat lintSimonas Kazlauskas-2/+0
Part of #37166
2017-01-19travis: Get an emscripten builder onlineAlex Crichton-0/+14
This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-19Feature gateVadim Chugunov-0/+13
2017-01-19Auto merge of #38465 - japaric:msp430-interrupt, r=eddybbors-0/+26
calling convention for MSP430 interrupts This calling convention is used to define interrup handlers on MSP430 microcontrollers. Usage looks like this: ``` rust #[no_mangle] #[link_section = "__interrupt_vector_10"] pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0; unsafe extern "msp430-interrupt" fn tim0() { P1OUT.write(0x00); } ``` which generates the following assembly: ``` asm Disassembly of section __interrupt_vector_10: 0000fff2 <TIM0_VECTOR>: fff2: 10 c0 interrupt service routine at 0xc010 Disassembly of section .text: 0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>: c010: c2 43 21 00 mov.b #0, &0x0021 ;r3 As==00 c014: 00 13 reti ... ```
2017-01-19test slice patterns with exclusive range patternsOliver Schneider-0/+54
2017-01-19check exclusive_range_pattern feature gateOliver Schneider-0/+0
2017-01-19add cfail test for the new feature gateJorge Aparicio-0/+19
2017-01-19Rollup merge of #39151 - canndrew:feature-gate-uninhabited-references, r=brsonGuillaume Gomez-0/+19
Feature gate `&Void`'s uninhabitedness. Here's a totally crazy PR which should never be merged.
2017-01-19Rollup merge of #39149 - ↵Guillaume Gomez-1/+16
circuitfox:E0122-type-def-trait-bounds-where-clause, r=arielb1 E0122 should apply with where clauses Fixes #39122
2017-01-19Rollup merge of #38970 - apasel422:may-dangle, r=pnkfelixGuillaume Gomez-1/+23
Deprecate `#[unsafe_destructor_blind_to_params]` CC #34761 r? @pnkfelix
2017-01-19add exclusive range patterns under a feature gateOliver Schneider-0/+24
2017-01-18calling convention for MSP430 interruptsJorge Aparicio-0/+7
This calling convention is used to define interrup handlers on MSP430 microcontrollers. Usage looks like this: ``` rust #[no_mangle] #[link_section = "__interrupt_vector_10"] pub static TIM0_VECTOR: unsafe extern "msp430-interrupt" fn() = tim0; unsafe extern "msp430-interrupt" fn tim0() { P1OUT.write(0x00); } ``` which generates the following assembly: ``` asm Disassembly of section __interrupt_vector_10: 0000fff2 <TIM0_VECTOR>: fff2: 10 c0 interrupt service routine at 0xc010 Disassembly of section .text: 0000c010 <_ZN3msp4tim017h3193b957fd6a4fd4E>: c010: c2 43 21 00 mov.b #0, &0x0021 ;r3 As==00 c014: 00 13 reti ... ```
2017-01-18Feature gate `&Void`'s uninhabitedness.Andrew Cann-0/+19
References to empty types are only considered empty if feature(never_type) is enabled.
2017-01-18E0122 should apply with where clausesChris Stankus-1/+16
2017-01-18Auto merge of #38168 - estebank:help-E0034, r=nrcbors-88/+0
E0034: provide disambiguated syntax for candidates For a given file ```rust trait A { fn foo(&self) {} } trait B : A { fn foo(&self) {} } fn bar<T: B>(a: &T) { a.foo() } ``` provide the following output ``` error[E0034]: multiple applicable items in scope --> file.rs:6:5 | 6 | a.foo(1) | ^^^ multiple `foo` found | note: candidate #1 is defined in the trait `A` --> file.rs:2:11 | 2 | trait A { fn foo(&self, a: usize) {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to use it here write `A::foo(&a, 1)` instead --> file.rs:6:5 | 6 | a.foo(1) | ^^^ note: candidate #2 is defined in the trait `B` --> file.rs:3:15 | 3 | trait B : A { fn foo(&self, a: usize) {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to use it here write `B::foo(&a, 1)` instead --> file.rs:6:5 | 6 | a.foo(1) | ^^^ ``` Fix #37767.
2017-01-18Auto merge of #39019 - nikomatsakis:issue-38919, r=eddybbors-0/+15
only consider value items when searching for methods, not types Fixes #38919 r? @eddyb
2017-01-17check inherent impls of traits for overlap as wellNiko Matsakis-0/+17
2017-01-17more complete error messageNiko Matsakis-1/+1
2017-01-17Teach Diagnostics to highlight textEsteban Küber-156/+0
2017-01-17Change unreachable patterns ICEs to warningsAndrew Cann-0/+46
Allow code with unreachable `?` and `for` patterns to compile. Add some tests.
2017-01-16Move "completed feature gate checking" pass to after "name resolution" pass ↵Austin Bonander-0/+5
so proc-macro-attribute feature gate check can use resolve
2017-01-17AST/HIR: Merge ObjectSum and PolyTraitRefVadim Petrochenkov-17/+6
2017-01-16Auto merge of #38806 - comex:lint-attr-fix, r=nrcbors-0/+19
Fix lint attributes on non-item nodes. Currently, late lint checking uses two HIR visitors: LateContext and IdVisitor. IdVisitor only overrides visit_id, and for each node searches for builtin lints previously added to the session; LateContext overrides a number of methods, and runs late lints. When LateContext encounters an item, it first has IdVisitor walk everything in it except nested items (OnlyBodies), then recurses into it itself - i.e. there are two separate walks. Aside from apparently being unnecessary, this separation prevents lint attributes (allow/deny/warn) on non-item HIR nodes from working properly. Test case: ```rust // generates warning without this change fn main() { #[allow(unreachable_code)] loop { break; break; } } ``` LateContext contains logic to merge attributes seen into the current lint settings while walking (with_lint_attrs), but IdVisitor does not. So such attributes will affect late lints (because they are called from LateContext), and if the node contains any items within it, they will affect builtin lints within those items (because that IdVisitor is run while LateContext is within the attributed node), but otherwise the attributes will be ignored for builtin lints. This change simply removes IdVisitor and moves its visit_id into LateContext itself. Hopefully this doesn't break anything... Also added walk calls to visit_lifetime and visit_lifetime_def respectively, so visit_lifetime_def will recurse into the lifetime and visit_lifetime will recurse into the name. In principle this could confuse lint plugins. This is "necessary" because walk_lifetime calls visit_id on the lifetime; of course, an alternative would be directly calling visit_id (which would require manually iterating over the lifetimes in visit_lifetime_def), but that seems less clean.
2017-01-15Auto merge of #39040 - estebank:relevant-impl-multiline, r=nikomatsakisbors-85/+0
Use multiline Diagnostic for "relevant impl" list Provide the following output: ``` error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:38:8 | 38 | f1.foo(1usize); | ^^^ the trait `Foo<usize>` is not implemented for `Bar` | = help: the following implementations were found: <Bar as Foo<i8>> <Bar as Foo<i16>> <Bar as Foo<i32>> <Bar as Foo<u8>> and 2 others error: aborting due to previous error ``` instead of ``` error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:38:8 | 38 | f1.foo(1usize); | ^^^ the trait `Foo<usize>` is not implemented for `Bar` | = help: the following implementations were found: = help: <Bar as Foo<i8>> = help: <Bar as Foo<i16>> = help: <Bar as Foo<i32>> = help: <Bar as Foo<u8>> = help: and 2 others error: aborting due to previous error ```
2017-01-15Improve the warning cycle for `use $crate;`.Jeffrey Seyfried-3/+10
2017-01-14Merge branch 'master' into lint-attr-fixcomex-413/+744