about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-12-30TidySimonas Kazlauskas-0/+18
This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-30Feature gate the 128 bit typesSimonas Kazlauskas-0/+28
Dangling a carrot in front of a donkey. This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-29Add a test for #38273Nick Cameron-0/+21
Closes 38273
2016-12-29Change --crate-type metadata to --emit=metadataNick Cameron-8/+6
2016-12-28rustc: move function arguments into hir::Body.Eduard-Mihai Burtescu-3/+3
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-47/+16
2016-12-28rustc: separate TraitItem from their parent Item, just like ImplItem.Eduard-Mihai Burtescu-3/+6
2016-12-26More systematic error reporting in path resolutionVadim Petrochenkov-183/+278
2016-12-26Move some compile-fail tests into UI directoryVadim Petrochenkov-991/+0
2016-12-25Auto merge of #38539 - jseyfried:fix_resolve_hang, r=eddybbors-1/+3
resolve: fix non-termination Fixes #34324. r? @eddyb
2016-12-22Fix non-termination in `resolve`.Jeffrey Seyfried-1/+3
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-1/+1
2016-12-20Merge branch 'rfc_1560_warning_cycle' of https://github.com/jseyfried/rust ↵Alex Crichton-0/+30
into rollup Conflicts: src/librustc_resolve/lib.rs src/librustc_resolve/resolve_imports.rs
2016-12-20Rollup merge of #38486 - est31:master, r=petrochenkovAlex Crichton-0/+15
Add regression test for #38458 Closes #38458
2016-12-20Rollup merge of #38245 - estebank:cast-deref-hint-2, r=nikomatsakisAlex Crichton-123/+0
When cast needs a dereference point at full cast After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring: <img width="471" alt="error span pointing at the entire cast" src="https://cloud.githubusercontent.com/assets/1606434/21024245/8797fc2e-bd38-11e6-82c1-66c281c656c1.png"> instead of <img width="471" alt="error span pointing at the type of the cast" src="https://cloud.githubusercontent.com/assets/1606434/21023777/d4814aa6-bd36-11e6-9fc3-b2a0ea5ee15d.png"> Move `compile-fail` test to `ui` test.
2016-12-20Rollup merge of #38171 - jseyfried:cleanup, r=nrcAlex Crichton-11/+11
Miscellaneous cleanup/refactoring in `resolve` and `syntax::ext` r? @nrc
2016-12-20Rollup merge of #38150 - estebank:fix-23286, r=nikomatsakisAlex Crichton-0/+43
Point out the known type when field doesn't satisfy bound For file ```rust use std::path::Path; fn f(p: Path) { } ``` provide the following error ```nocode error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path` --> file.rs:3:6 | 3 | fn f(p: Path) { } | ^ within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]` | = note: `[u8]` does not have a constant size known at compile-time = note: required because it appears within the type `std::path::Path` = note: all local variables must have a statically known size ``` Fix #23286.
2016-12-20Add regression test for #38458est31-0/+15
2016-12-19resolve: clean up diagnostics for name conflicts.Jeffrey Seyfried-11/+11
2016-12-15Warn unused type aliasesSeo Sanghyeon-0/+22
2016-12-15Demote most backwards incompatible ambiguity errors from RFC 1560 to warnings.Jeffrey Seyfried-0/+30
2016-12-14When cast needs a dereference point at full castEsteban Küber-123/+0
After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference: ``` error: casting `&{float}` as `f32` is invalid --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:30 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | ^^^^^^^^ cannot cast `&{float}` as `f32` | help: did you mean `*s`? --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:30 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | ^ ``` instead of ``` error: casting `&{float}` as `f32` is invalid --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:35 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | - ^^^ | | | | | did you mean `*s`? | cannot cast `&{float}` as `f32` ```
2016-12-15Fix regression in resolution of primitive typesVadim Petrochenkov-0/+20
2016-12-14review commentsEsteban Küber-0/+34
2016-12-12Auto merge of #38057 - KiChjang:display-formal-type-param, r=nikomatsakisbors-18/+18
Display better error messages for E0282 Fixes #36554.
2016-12-08Change error to E0572Guillaume Gomez-1/+1
2016-12-08Add E0571 testGuillaume Gomez-0/+13
2016-12-08Point out the known type when field doesn't satisfy boundEsteban Küber-0/+9
For file ```rust use std::path::Path; fn f(p: Path) { } ``` provide the following error ```nocode error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path` --> file.rs:3:6 | 3 | fn f(p: Path) { } | ^ within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]` | = note: `[u8]` does not have a constant size known at compile-time = note: required because it appears within the type `std::path::Path` = note: all local variables must have a statically known size ```
2016-12-07Rollup merge of #38085 - estebank:empty-import-list-fix-38012, r=jseyfriedGuillaume Gomez-3/+9
Warn when an import list is empty For a given file ```rust use std::*; use std::{}; ``` output the following warnings ``` warning: unused import: `use std::{};`, #[warn(unused_imports)] on by default --> file.rs:2:1 | 2 | use std::{}; | ^^^^^^^^^^^^ warning: unused import: `std::*;`, #[warn(unused_imports)] on by default --> file.rs:1:5 | 1 | use std::*; | ^^^^^^^ ```
2016-12-06Auto merge of #37973 - vadimcn:dllimport, r=alexcrichtonbors-6/+38
Implement RFC 1717 Implement the first two points from #37403. r? @alexcrichton
2016-12-05Warn when an import list is emptyEsteban Küber-3/+9
For a given file ```rust use std::*; use std::{}; ``` output the following warnings ``` warning: unused import: `use std::{};`, #[warn(unused_imports)] on by default --> file.rs:2:1 | 2 | use std::{}; | ^^^^^^^^^^^^ warning: unused import: `std::*;`, #[warn(unused_imports)] on by default --> file.rs:1:5 | 1 | use std::*; | ^^^^^^^ ```
2016-12-06Auto merge of #38121 - jonathandturner:better_e0061, r=nikomatsakisbors-22/+25
Point arg num mismatch errors back to their definition This PR updates the arg num errors (like E0061) to point back at the function definition where they were defined. Before: ``` error[E0061]: this function takes 2 parameters but 1 parameter was supplied --> E0061.rs:18:7 | 18 | f(0); | ^ | = note: the following parameter types were expected: = note: u16, &str ``` Now: ``` error[E0061]: this function takes 2 parameters but 1 parameter was supplied --> E0061.rs:18:7 | 11 | fn f(a: u16, b: &str) {} | ------------------------ defined here ... 18 | f(0); | ^ expected 2 parameters ``` This is an incremental improvement. We probably want to underline only the function name and also have support for functions defined in crates outside of the current crate. r? @nikomatsakis
2016-12-05Auto merge of #38093 - mikhail-m1:stack-overflow, r=arielb1bors-0/+26
fix stack overflow by enum and cont issue #36163 some paths were skipped while checking for recursion. I fixed bug reproduces on win64 cargo test. In previous PR #36458 time complexity was exponential in case of linked const values. Now it's linear. r? @alexcrichton
2016-12-04Auto merge of #38082 - jseyfried:macro_invocation_paths, r=nrcbors-41/+45
macros: support invocation paths (e.g. `foo::bar!()`) behind `#![feature(use_extern_macros)]` r? @nrc
2016-12-03Update error expectationsKeith Yeung-18/+18
2016-12-03fix stack overflow by enum and cont issue #36163, some paths were skipped ↵Mikhail Modin-0/+26
while checking for recursion.
2016-12-03Auto merge of #38079 - BurntSushi:attrtarget, r=alexcrichtonbors-0/+13
Add new #[target_feature = "..."] attribute. This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. I've also expanded the x86 target feature whitelist.
2016-12-01Tighten up error checking of library renames.Vadim Chugunov-0/+48
2016-12-01Remove the "linked_from" feature.Vadim Chugunov-16/+0
2016-12-01Point arg num mismatch errors back to their definitionJonathan Turner-22/+25
2016-12-02limit the length of types in monomorphizationAriel Ben-Yehuda-1/+37
This adds the new insta-stable `#![type_size_limit]` crate attribute to control the limit, and is obviously a [breaking-change] fixable by that.
2016-11-30Add tests.Jeffrey Seyfried-41/+45
2016-11-30Auto merge of #38014 - jseyfried:refactor_path_resolution, r=nrcbors-1/+1
resolve: refactor path resolution This is a pure refactoring, modulo minor diagnostics improvements. r? @nrc
2016-11-29Auto merge of #37965 - Mark-Simulacrum:trait-obj-to-exis-predicate, r=eddybbors-19/+18
Refactor TraitObject to Slice<ExistentialPredicate> For reference, the primary types changes in this PR are shown below. They may add in the understanding of what is discussed below, though they should not be required. We change `TraitObject` into a list of `ExistentialPredicate`s to allow for a couple of things: - Principal (ExistentialPredicate::Trait) is now optional. - Region bounds are moved out of `TraitObject` into `TyDynamic`. This permits wrapping only the `ExistentialPredicate` list in `Binder`. - `BuiltinBounds` and `BuiltinBound` are removed entirely from the codebase, to permit future non-constrained auto traits. These are replaced with `ExistentialPredicate::AutoTrait`, which only requires a `DefId`. For the time being, only `Send` and `Sync` are supported; this constraint can be lifted in a future pull request. - Binder-related logic is extracted from `ExistentialPredicate` into the parent (`Binder<Slice<EP>>`), so `PolyX`s are inside `TraitObject` are replaced with `X`. The code requires a sorting order for `ExistentialPredicate`s in the interned `Slice`. The sort order is asserted to be correct during interning, but the slices are not sorted at that point. 1. `ExistentialPredicate::Trait` are defined as always equal; **This may be wrong; should we be comparing them and sorting them in some way?** 1. `ExistentialPredicate::Projection`: Compared by `ExistentialProjection::sort_key`. 1. `ExistentialPredicate::AutoTrait`: Compared by `TraitDef.def_path_hash`. Construction of `ExistentialPredicate`s is conducted through `TyCtxt::mk_existential_predicates`, which interns a passed iterator as a `Slice`. There are no convenience functions to construct from a set of separate iterators; callers must pass an iterator chain. The lack of convenience functions is primarily due to few uses and the relative difficulty in defining a nice API due to optional parts and difficulty in recognizing which argument goes where. It is also true that the current situation isn't significantly better than 4 arguments to a constructor function; but the extra work is deemed unnecessary as of this time. ```rust // before this PR struct TraitObject<'tcx> { pub principal: PolyExistentialTraitRef<'tcx>, pub region_bound: &'tcx ty::Region, pub builtin_bounds: BuiltinBounds, pub projection_bounds: Vec<PolyExistentialProjection<'tcx>>, } // after pub enum ExistentialPredicate<'tcx> { // e.g. Iterator Trait(ExistentialTraitRef<'tcx>), // e.g. Iterator::Item = T Projection(ExistentialProjection<'tcx>), // e.g. Send AutoTrait(DefId), } ```
2016-11-29Add new #[target_feature = "..."] attribute.Andrew Gallant-0/+13
This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. This commit also expands the target feature whitelist to include lzcnt, popcnt and sse4a. Namely, lzcnt and popcnt have their own CPUID bits, but were introduced with SSE4.
2016-11-29Auto merge of #37863 - mikhail-m1:mut_error, r=nikomatsakisbors-381/+0
add hint to fix error for immutable ref in arg fix #36412 part of #35233 r? @jonathandturner
2016-11-28Remove auto_traits from PartitionedBoundsMark-Simulacrum-1/+1
2016-11-28Refactor TyTrait to contain a interned ExistentialPredicate slice.Mark-Simulacrum-10/+9
Renames TyTrait to TyDynamic.
2016-11-29Refactor path resoloution.Jeffrey Seyfried-1/+1
2016-11-29add hint to fix error for immutable ref in argMikhail Modin-381/+0