summary refs log tree commit diff
path: root/src/test/ui/span
AgeCommit message (Collapse)AuthorLines
2017-12-31Reword trying to operate in immutable fieldsEsteban Küber-2/+2
The previous message ("cannot assign/mutably borrow immutable field") when trying to modify a field of an immutable binding gave the (incorrect) impression that fields can be mutable independently of their ADT's binding. Slightly reword the message to read "cannot assign/mutably borrow field of immutable binding".
2017-12-21Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkovGuillaume Gomez-14/+10
Use def span for associated function suggestions
2017-12-19Use def span for associated function suggestionsEsteban Küber-14/+10
2017-12-19Point at def span in "missing in impl" errorEsteban Küber-52/+21
2017-12-18Tweak "unecessary unsafe block" error spansEsteban Küber-65/+22
2017-12-15Same change to point at borrow for mir errorsEsteban Küber-38/+39
2017-12-14Point at var in short lived borrowsEsteban Küber-359/+404
2017-12-14Remove NOTE/HELP annotations from UI testsVadim Petrochenkov-206/+118
2017-12-14Auto merge of #46633 - estebank:arg-mismatch, r=arielb1bors-15/+15
Point at whole method call instead of args To avoid confusion in cases where the code is ```rust fn foo() {} / foo( | bar() | ^^^ current diagnostics point here for arg count mismatch | ); |_^ new diagnostic span points here ``` as this leads to confusion making people think that the diagnostic is talking about `bar`'s arg count, not `foo`'s. Point at `fn`s definition on arg mismatch, just like we do for closures. Re #42855, Fix #45633.
2017-12-10Point at whole method call instead of argsEsteban Küber-15/+15
To avoid confusion in cases where the code is ```rust fn foo() {} / foo( | bar() | ^^^ current diagnostics point here for arg count mismatch | ); |_^ new diagnostic span points here ``` as this leads to confusion making people think that the diagnostic is talking about `bar`'s arg count, not `foo`'s. Point at `fn`s definition on arg mismatch, just like we do for closures.
2017-12-10Update ui tests' line numbers.Tommy Ip-9/+9
2017-12-10Add must-compile-successfully comment to appropriate ui tests.Tommy Ip-0/+4
2017-12-01Use suggestions instead of notes ref mismatchesEsteban Küber-5/+9
On type mismatch errors, use a suggestion when encountering minimal differences in type differences due to refs, instead of a note.
2017-11-29Rollup merge of #46287 - SimonSapin:stable-constness, r=aturonkennytm-3/+3
Stabilize const-calling existing const-fns in std Fixes #46038
2017-11-26Stabilize const-calling existing const-fns in stdSimon Sapin-3/+3
Fixes #46038
2017-11-26mention nightly in -Z external-macro-backtrace noteAlex Burka-4/+4
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-297/+314
2017-11-23Auto merge of #46024 - estebank:no-variant, r=petrochenkovbors-0/+3
Use the proper term when using non-existing variant When using a non-existing variant, function or associated item, refer to the proper term, instead of defaulting to "associated item" in diagnostics. Fix #28972. ``` error[E0599]: no variant named `Quux` found for type `Foo` in the current scope --> file.rs:7:9 | 7 | Foo::Quux(..) =>(), | ^^^^^^^^^^^^^ ```
2017-11-21Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1bors-3/+0
move closure kind, signature into `ClosureSubsts` Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects: - It means that the closure's type changes as inference finds out more things, which is very nice. - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators). - It avoids cyclic closures calls. - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410). We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed. r? @arielb1
2017-11-21Auto merge of #45701 - cramertj:impl-trait-this-time, r=eddybbors-24/+0
impl Trait Lifetime Handling This PR implements the updated strategy for handling `impl Trait` lifetimes, as described in [RFC 1951](https://github.com/rust-lang/rfcs/blob/master/text/1951-expand-impl-trait.md) (cc #42183). With this PR, the `impl Trait` desugaring works as follows: ```rust fn foo<T, 'a, 'b, 'c>(...) -> impl Foo<'a, 'b> { ... } // desugars to exists type MyFoo<ParentT, 'parent_a, 'parent_b, 'parent_c, 'a, 'b>: Foo<'a, 'b>; fn foo<T, 'a, 'b, 'c>(...) -> MyFoo<T, 'static, 'static, 'static, 'a, 'b> { ... } ``` All of the in-scope (parent) generics are listed as parent generics of the anonymous type, with parent regions being replaced by `'static`. Parent regions referenced in the `impl Trait` return type are duplicated into the anonymous type's generics and mapped appropriately. One case came up that wasn't specified in the RFC: it's possible to write a return type that contains multiple regions, neither of which outlives the other. In that case, it's not clear what the required lifetime of the output type should be, so we generate an error. There's one remaining FIXME in one of the tests: `-> impl Foo<'a, 'b> + 'c` should be able to outlive both `'a` and `'b`, but not `'c`. Currently, it can't outlive any of them. @nikomatsakis and I have discussed this, and there are some complex interactions here if we ever allow `impl<'a, 'b> SomeTrait for AnonType<'a, 'b> { ... }`, so the plan is to hold off on this until we've got a better idea of what the interactions are here. cc #34511. Fixes #44727.
2017-11-20address review commentsAlex Burka-4/+4
2017-11-19use -Z flag instead of env varAlex Burka-4/+4
2017-11-19update UI testsAlex Burka-4/+4
2017-11-18give better error messages when a cycle arisesNiko Matsakis-3/+0
2017-11-17Fix impl Trait Lifetime HandlingTaylor Cramer-24/+0
After this change, impl Trait existentials are desugared to a new `abstract type` definition paired with a set of lifetimes to apply. In-scope generics are included as parents of the `abstract type` generics. Parent regions are replaced with static, and parent regions referenced in the `impl Trait` type are duplicated at the end of the `abstract type`'s generics.
2017-11-16Remove left over dead code from suggestion diagnostic refactoringOliver Schneider-6/+0
2017-11-15Point to ADT definition when not finding variant, method, assoc typeEsteban Küber-0/+3
2017-11-12Auto merge of #45870 - mikeyhew:arbitrary_self_types, r=arielb1bors-4/+4
Implement arbitrary_self_types r? @arielb1 cc @nikomatsakis Partial implementation of #44874. Supports trait and struct methods with arbitrary self types, as long as the type derefs (transitively) to `Self`. Doesn't support raw-pointer `self` yet. Methods with non-standard self types (i.e. anything other than `&self, &mut self, and Box<Self>`) are not object safe, because dynamic dispatch hasn't been implemented for them yet. I believe this is also a (partial) fix for #27941.
2017-11-10Auto merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-8/+8
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-11-09Don't emit the feature error if it's an invalid self typeMichael Hewson-10/+1
2017-11-08update ui test to new error messageMichael Hewson-5/+14
2017-11-07Update invalid inline arg test.Michael Woerister-1/+3
2017-11-06collect unused unsafe codeAriel Ben-Yehuda-8/+8
FIXME: de-uglify
2017-10-31rustc_typeck: use subtyping on the LHS of binops.Eduard-Mihai Burtescu-1/+1
2017-10-25Update ui tests for error message deduplication.Michael Woerister-6/+0
2017-10-13Pass the full span for method callsGeoffry Song-13/+49
2017-09-29Auto merge of #44847 - estebank:unused-signature, r=nikomatsakisbors-0/+76
Point at signature on unused lint ``` warning: struct is never used: `Struct` --> $DIR/unused-warning-point-at-signature.rs:22:1 | 22 | struct Struct { | ^^^^^^^^^^^^^ ``` Fix #33961.
2017-09-25Point at signature on unused lintEsteban Küber-0/+76
2017-09-21suggest an outer attribute when `#![derive(...)]` (predictably) failsZack M. Davis-1/+1
2017-09-21only set non-ADT derive error once per attribute, not per traitZack M. Davis-0/+24
A slight eccentricity of this change is that now non-ADT-derive errors prevent derive-macro-not-found errors from surfacing (see changes to the gating-of-derive compile-fail tests). Resolves #43927.
2017-09-21Auto merge of #44215 - oli-obk:import_sugg, r=nrcbors-1/+1
don't suggest placing `use` statements into expanded code r? @nrc fixes #44210 ```rust #[derive(Debug)] struct Foo; type X = Path; ``` will try to place `use std::path::Path;` between `#[derive(Debug)]` and `struct Foo;` I am not sure how to obtain a span before the first attribute, because derive attributes are removed during expansion. It would be trivial to detect this case and place the `use` after the item, but that would be somewhat weird I think.
2017-09-16Auto merge of #43017 - durka:stabilize-const-invocation, r=eddybbors-3/+3
Individualize feature gates for const fn invocation This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward. This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review. - `std::cell` - `Cell::new` - `RefCell::new` - `UnsafeCell::new` - `std::mem` - `size_of` - `align_of` - `std::ptr` - `null` - `null_mut` - `std::sync` - `atomic` - `Atomic{Bool,Ptr,Isize,Usize}::new` - `once` - `Once::new` - primitives - `{integer}::min_value` - `{integer}::max_value` Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time. After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR. - `std::sync` - `atomic` - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT` - `once` - `ONCE_INIT`
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-3/+3
2017-09-14"avoid" is a better word here than "disable"est31-1/+1
2017-09-09Stabilize drop_types_in_const.Eduard-Mihai Burtescu-9/+4
2017-09-09Auto merge of #44212 - eddyb:drop-const, r=nikomatsakisbors-5/+7
Allow Drop types in const's too, with #![feature(drop_types_in_const)]. Implements the remaining amendment, see #33156. cc @SergioBenitez r? @nikomatsakis
2017-09-02Allow Drop types in const's too, with #![feature(drop_types_in_const)].Eduard-Mihai Burtescu-5/+7
2017-08-31WIP: don't suggest placing `use` statements into expanded codeOliver Schneider-1/+1
2017-08-30rustc: Remove the `used_unsafe` field on TyCtxtAlex Crichton-8/+8
Now that lint levels are available for the entire compilation, this can be an entirely local lint in `effect.rs`
2017-08-29Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakisbors-0/+73
feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport There were several feature-gated attributes for which the feature-not-available error spans would point to the item annotated with the gated attribute, when it would make more sense for the span to point to the attribute itself: if the attribute is removed, the function/struct/_&c._ likely still makes sense and the program will compile. (Note that we decline to make the analogous change for the `main`, `start`, and `plugin_registrar` features, for in those cases it makes sense for the span to implicate the entire function, of which there is little hope of using without the gated attribute.) ![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)