about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-05-24Auto merge of #50943 - oli-obk:cleanups, r=estebankbors-42/+0
impl Trait diagnostic/test cleanups
2018-05-22Tweak `main` type arguments and where clause spansEsteban Küber-1/+1
Tweak the spans for error when finding type arguments or where clauses in main and start functions.
2018-05-22Fix a typo in a commentOliver Schneider-1/+1
2018-05-22Report let bindings and statements as unstableOliver Schneider-29/+55
2018-05-21Move a test to ui tests so we can observe the output changes betterOliver Schneider-42/+0
2018-05-20Auto merge of #50851 - eddyb:the-only-constant, r=nikomatsakisbors-0/+43
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants". Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's. That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself. Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected). This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor). * fixes #48838 * fixes #50600 * fixes #50688 * fixes #50689 * obsoletes #50623 r? @nikomatsakis
2018-05-20Auto merge of #50803 - varkor:never-transmute-never, r=eddybbors-0/+33
Fix an ICE when attempting to transmute an uninhabited type Fixes https://github.com/rust-lang/rust/issues/50570.
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-0/+43
constants".
2018-05-19Auto merge of #50760 - petrochenkov:legimp, r=nikomatsakisbors-8/+2
Turn deprecation lint `legacy_imports` into a hard error Closes https://github.com/rust-lang/rust/issues/38260 The lint was introduced in Dec 2016, then made deny-by-default in Jun 2017 when crater run found 0 regressions caused by it. This lint requires some not entirely trivial amount of import resolution logic that (surprisingly or not) interacts with `feature(use_extern_macros)` (https://github.com/rust-lang/rust/issues/35896), so it would be desirable to remove it before stabilizing `use_extern_macros`. In particular, this PR fixes the failing example in https://github.com/rust-lang/rust/issues/50725 (but not the whole issue, `use std::panic::{self}` still can cause other undesirable errors when `use_extern_macros` is enabled).
2018-05-18Auto merge of #50653 - oli-obk:bad_const, r=cramertjbors-11/+8
Make the `const_err` lint `deny`-by-default At best these things are runtime panics (debug mode) or overflows (release mode). More likely they are public constants that are unused in the crate declaring them. This is not a breaking change, as dependencies won't break and root crates can `#![warn(const_err)]`, though I don't know why anyone would do that.
2018-05-17Fix an ICE when attempting to transmute an uninhabited typevarkor-0/+33
2018-05-17Rename trans to codegen everywhere.Irina Popa-5/+5
2018-05-16Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakisbors-5/+4
Implement RFC 2056 trivial constraints in where clauses This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet. Some things that are worth noting and are maybe not want we want * `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow. * ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~ r? @nikomatsakis
2018-05-15Update existing tests for trivial bounds changesMatthew Jasper-5/+4
2018-05-15Auto merge of #50351 - varkor:vestigial-never-conversion, r=nikomatsakisbors-3/+2
Remove vestigial diverging !-coercion Such conversions are no longer permitted. Fixes #50350. r? @nikomatsakis
2018-05-15Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearthbors-30/+0
Ensure derive(PartialOrd) is no longer accidentally exponential Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572. Closes #49505. r? @Manishearth (sorry for changing it again so soon!) Close #50755
2018-05-15Turn deprecation lint `legacy_imports` into a hard errorVadim Petrochenkov-8/+2
2018-05-12rustc: Only suggest deleting `extern crate` if it worksAlex Crichton-0/+30
This commit updates one of the edition lints to only suggest deleting `extern crate` if it actually works. Otherwise this can yield some confusing behavior with rustfix specifically where if you accidentally deny the `rust_2018_idioms` lint in the 2015 edition it's suggesting features that don't work!
2018-05-12rustc: Allow an edition's feature on that editionAlex Crichton-0/+16
This commit fixes a hard error where the `#![feature(rust_2018_preview)]` feature was forbidden to be mentioned when the `--edition 2018` flag was passed. This instead silently accepts that feature gate despite it not being necessary. It's intended that this will help ease the transition into the 2018 edition as users will, for the time being, start off with the `rust_2018_preview` feature and no longer immediately need to remove it. Closes #50662
2018-05-12Make the `const_err` lint `deny`-by-defaultOliver Schneider-11/+8
2018-05-08Auto merge of #50390 - hdhoang:46205_deny_by_default, r=nikomatsakisbors-2/+0
lint: deny incoherent_fundamental_impls by default Warn the ecosystem of the pending intent-to-disallow in #49799. There are 4 ICEs on my machine, look unrelated (having happened before in https://github.com/rust-lang/rust/issues/49146#issuecomment-384473523) ```rust thread 'main' panicked at 'assertion failed: position <= slice.len()', libserialize/leb128.rs:97:1 ``` ``` [run-pass] run-pass/allocator/xcrate-use2.rs [run-pass] run-pass/issue-12133-3.rs [run-pass] run-pass/issue-32518.rs [run-pass] run-pass/trait-default-method-xc-2.rs ``` r? @nikomatsakis
2018-05-07Auto merge of #50454 - Manishearth:edition-preview-fixes, r=alexcrichtonbors-0/+7
Various edition preview fixes Implement a bunch of things discussed in the meeting.
2018-05-06in which the must-use additional messaging is tucked into a noteZack M. Davis-3/+7
Also, a comment is edited to reflect that spaces around the equals-sign in attributes is the standard (q.v. rust-lang-nursery/fmt-rfcs@bea80532e7).
2018-05-06resolved conflict with upstream commitBrad Gibson-125/+186
2018-05-06Fix assertion message generationShotaro Yamada-0/+19
2018-05-04Make extern_absolute_paths only work on the new editionManish Goregaokar-0/+7
2018-05-04Auto merge of #49870 - ↵bors-0/+61
pnkfelix:issue-27282-immut-borrow-all-pat-ids-in-guards, r=nikomatsakis Immutably and implicitly borrow all pattern ids for their guards (NLL only) This is an important piece of rust-lang/rust#27282. It applies only to NLL mode. It is a change to MIR codegen that is currently toggled on only when NLL is turned on. It thus affect MIR-borrowck but not the earlier static analyses (such as the type checker). This change makes it so that any pattern bindings of type T for a match arm will map to a `&T` within the context of the guard expression for that arm, but will continue to map to a `T` in the context of the arm body. To avoid surfacing this type distinction in the user source code (which would be a severe change to the language and would also require far more revision to the compiler internals), any occurrence of such an identifier in the guard expression will automatically get a deref op applied to it. So an input like: ```rust let place = (1, Foo::new()); match place { (1, foo) if inspect(foo) => feed(foo), ... } ``` will be treated as if it were really something like: ```rust let place = (1, Foo::new()); match place { (1, Foo { .. }) if { let tmp1 = &place.1; inspect(*tmp1) } => { let tmp2 = place.1; feed(tmp2) }, ... } ``` And an input like: ```rust let place = (2, Foo::new()); match place { (2, ref mut foo) if inspect(foo) => feed(foo), ... } ``` will be treated as if it were really something like: ```rust let place = (2, Foo::new()); match place { (2, Foo { .. }) if { let tmp1 = & &mut place.1; inspect(*tmp1) } => { let tmp2 = &mut place.1; feed(tmp2) }, ... } ``` In short, any pattern binding will always look like *some* kind of `&T` within the guard at least in terms of how the MIR-borrowck views it, and this will ensure that guard expressions cannot mutate their the match inputs via such bindings. (It also ensures that guard expressions can at most *copy* values from such bindings; non-Copy things cannot be moved via these pattern bindings in guard expressions, since one cannot move out of a `&T`.)
2018-05-04Auto merge of #50409 - KiChjang:issue-50343, r=nikomatsakisbors-0/+17
Skip checking for unused mutable locals that have no name Fixes #50343.
2018-05-03Auto merge of #50413 - kennytm:rollup, r=kennytmbors-0/+20
Rollup of 12 pull requests Successful merges: - #50302 (Add query search order check) - #50320 (Fix invalid path generation in rustdoc search) - #50349 (Rename "show type declaration" to "show declaration") - #50360 (Clarify wordings of the `unstable_name_collision` lint.) - #50365 (Use two vectors in nearest_common_ancestor.) - #50393 (Allow unaligned reads in constants) - #50401 (Revert "Implement FromStr for PathBuf") - #50406 (Forbid constructing empty identifiers from concat_idents) - #50407 (Always inline simple BytePos and CharPos methods.) - #50416 (check if the token is a lifetime before parsing) - #50417 (Update Cargo) - #50421 (Fix ICE when using a..=b in a closure.) Failed merges:
2018-05-03Unit test for the new implicit borrow and deref within theFelix S. Klock II-0/+61
guard expressions of matches (activated only when using new NLL mode). Review feedback: removed 27282 from filename. (The test still references it in a relevant comment in the file itself so that seemed like a reasonable compromise.)
2018-05-03Auto merge of #50030 - flip1995:rfc2103, r=petrochenkovbors-0/+49
Implement tool_attributes feature (RFC 2103) cc #44690 This is currently just a rebased and compiling (hopefully) version of #47773. Let's see if travis likes this. I will add the implementation for `tool_lints` this week.
2018-05-03check if the token is a lifetime before parsingrleungx-0/+20
2018-05-03Auto merge of #50378 - varkor:repr-align-max-29, r=eddybbors-1/+4
Reduce maximum repr(align(N)) to 2^29 The current maximum `repr(align(N))` alignment is larger than the maximum alignment accepted by LLVM, which can cause issues for huge values of `N`, as seen in #49492. Fixes #49492. r? @rkruppe
2018-05-02Skip checking for unused mutable locals that have no nameKeith Yeung-0/+17
2018-05-02lint: deny incoherent_fundamental_impls by defaultHoàng Đức Hiếu-2/+0
Warn the ecosystem of the pending intent-to-disallow in #49799.
2018-05-02make it compile againflip1995-3/+3
2018-05-02Change Attribute::name to return the last segmentSeiichi Uchida-3/+3
And fix some typos
2018-05-02Add tests for a new feature 'tool_attributes'Seiichi Uchida-0/+49
2018-05-01Reduce the maximum alignment to repr(align(1 << 29))varkor-1/+4
This brings it into line with LLVM's maximum permitted alignment.
2018-05-01Test is no longer "accepted"Niko Matsakis-1/+1
2018-05-01Remove `macro_reexport`Vadim Petrochenkov-145/+0
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-05-01Fix coerce-to-bang testvarkor-3/+2
This was explicitly testing the behaviour which is now no longer permitted.
2018-04-30fixed some and added more testsBrad Gibson-0/+64
2018-05-01Rollup merge of #50330 - japaric:used, r=nagisakennytm-0/+28
check that #[used] is used only on statics this attribute has no effect on other items. This makes the implementation match what's described in the RFC. cc #40289 r? @nagisa
2018-04-30check that #[used] is used only on staticsJorge Aparicio-0/+28
2018-04-29Auto merge of #48605 - KiChjang:unused-mut-warning, r=nikomatsakisbors-18/+43
Allow MIR borrowck to catch unused mutable locals Fixes #47279. r? @nikomatsakis
2018-04-28Track unused mutable variables across closuresKeith Yeung-18/+43
2018-04-27Don't feature gate bang macros on 'proc_macro_path_invoc'.Sergio Benitez-7/+1
2018-04-28Rollup merge of #50273 - Amanieu:issue-49532, r=alexcrichtonkennytm-5/+5
Allow #[inline] on closures Fixes #49632
2018-04-28Rollup merge of #49968 - christianpoveda:stabilize_dyn, r=nikomatsakiskennytm-3/+0
Stabilize dyn trait This PR stabilizes RFC 2113. I followed the [stabilization guide](https://forge.rust-lang.org/stabilization-guide.html). Related issue: https://github.com/rust-lang/rust/issues/49218