summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-01-16rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_deriveBrian Anderson-0/+110
cc #30346 Conflicts: src/librustc_lint/lib.rs
2016-01-12Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-0/+17
2016-01-12Merge pull request #30847 from nikomatsakis/issue-29857-betaBrian Anderson-5/+60
[beta] Backport fix for issue 29857
2016-01-12The lint warnings are not reported since we report the errors first and then ↵Felix S. Klock II-2/+0
exit. I think that behavior is fine, so I am removing the expected warnings from these tests.
2016-01-12updated test to reflect loosening of check (for issue #30379).Felix S. Klock II-2/+6
2016-01-11permit coercions if `[error]` is found in either typeNiko Matsakis-1/+1
Conflicts: src/test/compile-fail/issue-3973.rs
2016-01-11Change error scheme so that if projection fails we generate `A::B` instead ↵Niko Matsakis-5/+60
of `TyError` Conflicts: src/test/compile-fail/issue-29857.rs
2015-12-07Auto merge of #30202 - oli-obk:fix/const_index_feature_gate, r=Aatchbors-1/+19
see https://github.com/rust-lang/rust/issues/29947#issuecomment-161781257 I also added some missing tests
2015-12-06Auto merge of #30241 - Manishearth:diag-30236, r=eddybbors-0/+18
r? @eddyb
2015-12-06Correct span for unused type parameter error in type alias (fixes #30236)Manish Goregaokar-0/+18
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-18/+9
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-18/+9
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05fix const index feature-gate regressionOliver Schneider-1/+19
2015-12-05Auto merge of #30102 - jFransham:feature/better-lifetime-errors, r=Manishearthbors-1/+5
Fixes #30086
2015-12-04Auto merge of #30084 - oli-obk:const_fn, r=pnkfelixbors-2/+3
2015-12-04Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelixbors-0/+203
See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701 - Added syntax support for attributes on expressions and all syntax nodes in statement position. - Extended `#[cfg]` folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. - Extended lint checker to recognize lint levels on expressions and locals. - As per RFC, attributes are not yet accepted on `if` expressions. Examples: ```rust let x = y; { ... } assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3)); let FOO = 0; ``` Implementation wise, there are a few rough corners and open questions: - The parser work ended up a bit ugly. - The pretty printer change was based mostly on guessing. - Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts, but where it seemed weird to accept attributes and hence the parser doesn't. This includes: - const expressions in patterns - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls) - on range expressions, since `#[attr] x .. y` parses as `(#[attr] x) .. y`, which is inconsistent with `#[attr] .. y` which would parse as `#[attr] (.. y)` - Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals. - Memory impact has not been measured yet. - A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work: ```rust let x = { #[cfg(foo)] Foo { data: x } #[cfg(not(foo))] Foo { data: y } }; ``` - One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way. - Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point? - Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder. - The work on pretty printer tests for this did trigger, but not fix errors regarding macros: - expression `foo![]` prints as `foo!()` - expression `foo!{}` prints as `foo!()` - statement `foo![];` prints as `foo!();` - statement `foo!{};` prints as `foo!();` - statement `foo!{}` triggers a `None` unwrap ICE.
2015-12-02Auto merge of #30133 - jseyfried:fix_regression, r=alexcrichtonbors-0/+22
r? @nikomatsakis
2015-12-01Auto merge of #25570 - oli-obk:const_indexing, r=nikomatsakisbors-1/+60
This PR allows the constant evaluation of index operations on constant arrays and repeat expressions. This allows index expressions to appear in the expression path of the length expression of a repeat expression or an array type. An example is ```rust const ARR: [usize; 5] = [1, 2, 3, 4, 5]; const ARR2: [usize; ARR[1]] = [42, 99]; ``` In most other locations llvm's const evaluator figures it out already. This is not specific to index expressions and could be remedied in the future.
2015-12-01Update lifetime compile testsJack Fransham-1/+5
2015-12-01Add test for #30089Jeffrey Seyfried-0/+22
2015-11-30Added test for attributes on parens hir folderMarvin Löbel-0/+34
2015-11-30Added a test for #[cfg] on non-optional positionsMarvin Löbel-0/+18
2015-11-28Auto merge of #29383 - petrochenkov:empstr, r=pnkfelixbors-46/+85
Fixes https://github.com/rust-lang/rust/issues/28692 Fixes https://github.com/rust-lang/rust/issues/28992 Fixes some other similar issues (see the tests) [breaking-change], needs crater run (cc @brson or @alexcrichton ) The pattern with parens `UnitVariant(..)` for unit variants seems to be popular in rustc (see the second commit), but mostly used by one person (@nikomatsakis), according to git blame. If it causes breakage on crates.io I'll add an exceptional case for it.
2015-11-27Auto merge of #30064 - fhartwig:macro-suggestions, r=sanxiynbors-0/+14
Fixes #13677 This does the same sort of suggestion for misspelt macros that we already do for misspelt identifiers. Example. Compiling this program: ```rust macro_rules! foo { ($e:expr) => ( $e ) } fn main() { fob!("hello!"); } ``` gives the following error message: ``` /Users/mcp/temp/test.rs:7:5: 7:8 error: macro undefined: 'fob!' /Users/mcp/temp/test.rs:7 fob!("hello!"); ^~~ /Users/mcp/temp/test.rs:7:5: 7:8 help: did you mean `foo`? /Users/mcp/temp/test.rs:7 fob!("hello!"); ``` I had to move the levenshtein distance function into libsyntax for this. Maybe this should live somewhere else (some utility crate?), but I couldn't find a crate to put it in that is imported by libsyntax and the other rustc crates.
2015-11-27implement calling of `const fn`-methods in true constantsOliver Schneider-2/+3
2015-11-26Added stmt_expr_attribute feature gateMarvin Löbel-0/+151
2015-11-26fix tidyAriel Ben-Yehuda-2/+2
2015-11-26Add '!' to macro name suggestion, use fileline_help instead of span_helpFlorian Hartwig-1/+1
2015-11-26Auto merge of #30015 - petrochenkov:staged, r=brsonbors-20/+0
Closes https://github.com/rust-lang/rust/issues/30008 `#[stable]`, `#[unstable]` and `#[rustc_deprecated]` are now guarded by `#[feature(staged_api)]` r? @brson
2015-11-26Add test for macro suggestionsFlorian Hartwig-0/+14
2015-11-25Add a testJonas Schievink-0/+17
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-7/+0
2015-11-25Remove `#[staged_api]`Vadim Petrochenkov-13/+0
2015-11-25Auto merge of #30011 - jonas-schievink:macro-context, r=nrcbors-1/+53
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-24Fix test failuresJonas Schievink-5/+5
2015-11-24Auto merge of #29934 - arielb1:constrained-projection-2, r=nikomatsakisbors-0/+30
Fixes #29861 - it was a bug I accidentally introduced in #26275. r? @nikomatsakis
2015-11-24Auto merge of #30000 - Manishearth:unreachable-call, r=nrcbors-0/+32
Fixes #1889
2015-11-24Fix unreachable code in libsyntaxManish Goregaokar-5/+0
2015-11-24Auto merge of #30001 - Detegr:master, r=Manishearthbors-0/+17
r? @Manishearth
2015-11-24Make unreachable_code lint warn on diverging call arguments as wellManish Goregaokar-0/+37
Fixes #1889
2015-11-23Auto merge of #29952 - petrochenkov:depr, r=brsonbors-29/+29
Part of https://github.com/rust-lang/rust/issues/29935 The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.
2015-11-23Print the macro context name on incomplete parseJonas Schievink-1/+53
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-23Add compile-fail test for issue #10969Antti Keränen-0/+17
2015-11-23Auto merge of #29530 - jseyfried:resolve, r=nikomatsakisbors-6/+6
Replace `TypeNsDef` and `ValueNsDef` with a more general type `NsDef`. Define a newtype `NameBinding` for `Rc<RefCell<Option<NsDef>>>` and refactor `NameBindings` to be a `NameBinding` for each namespace. Replace uses of `NameBindings` with `NameBinding` where only one binding is being used (in `NamespaceResult`, `Target,` etc). Refactor away `resolve_definition_of_name_in_module` and `NameDefinition`, fixing issue #4952.
2015-11-22Look up macro names as well when suggesting replacements for function ↵Manish Goregaokar-0/+13
resolve errors fixes #5780
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-29/+29
2015-11-20Auto merge of #29534 - oli-obk:fix/const_fn_eval, r=dotdashbors-0/+24
2015-11-20add feature gate `const_indexing`Oliver Schneider-0/+4
tracking issue is #29947
2015-11-19constrained_type_params: make projections depend on their trait-refAriel Ben-Yehuda-0/+30
As this is a soundness fix, it is a [breaking-change]. Fixes #29861.
2015-11-19Add special case for `UnitVariant(..)` patternsVadim Petrochenkov-3/+5