about summary refs log tree commit diff
path: root/src/test/ui/span
AgeCommit message (Collapse)AuthorLines
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)
2017-08-28Suggest `Ok(())` when encountering `Ok()`Oliver Schneider-0/+64
2017-08-28feature error span on attr. for fn_must_use, SIMD/align, macro reëxportZack M. Davis-0/+73
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.)
2017-08-22Fix fallout in tests.Jeffrey Seyfried-44/+38
2017-08-21Auto merge of #43929 - oli-obk:use_placement, r=nrcbors-8/+8
Improve placement of `use` suggestions r? @nrc cc @estebank @Mark-Simulacrum fixes #42835 fixes #42548 fixes #43769
2017-08-19Auto merge of #43933 - topecongiro:bad-span-for-attributes, r=petrochenkovbors-2/+2
Fix bad span for attributes Closes #42641.
2017-08-17Improve placement of `use` suggestionsOliver Schneider-8/+8
2017-08-17Update ui testsSeiichi Uchida-2/+2
2017-08-16Auto merge of #43864 - GuillaumeGomez:static-method-invalid-use, r=eddybbors-0/+3
Add help for static method invalid use Fixes #30391.
2017-08-16Stabilize rvalue promotion to 'static.Eduard-Mihai Burtescu-34/+42
2017-08-16Add a note to unused variablesGuillaume Gomez-0/+1
2017-08-14Add help for static method invalid useGuillaume Gomez-0/+3
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-32/+52
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-07-27Avoid duplicated errors for generic arguments in macro pathsVadim Petrochenkov-43/+1
2017-07-27Give span to angle bracketed generic argumentsVadim Petrochenkov-0/+182
2017-07-26Rollup merge of #43447 - estebank:import-span, r=nikomatsakisMark Simulacrum-0/+21
Point at path segment on module not found Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ``` Fix #43040.
2017-07-25Point at path segment on module not foundEsteban Küber-0/+21
Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ```
2017-07-20Use the macro structure spans instead of the invocationEsteban Küber-0/+30
2017-07-17Change some helps to suggestionsOliver Schneider-2/+2
2017-07-08Remove more anonymous trait method parametersVadim Petrochenkov-10/+10
2017-07-07Auto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakisbors-42/+40
remove associated_consts feature gate Currently struggling to run tests locally (something about jemalloc target missing). cc #29646
2017-07-06Only underline suggestion if it is not the only code being shownEsteban Küber-1/+1
2017-07-06Add extra whitespace for suggestionsEsteban Küber-0/+4
2017-07-06Make suggestion include the line numberEsteban Küber-2/+2
When there're more than one suggestions in the same diagnostic, they are displayed in their own block, instead of inline. In order to reduce confusion, those blocks now display the line number.
2017-07-06remove associated_consts feature gateSean McArthur-42/+40
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-2/+2
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-78/+78
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-26make lint on-by-default/implied-by messages appear only onceZack M. Davis-4/+2
From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
2017-06-12Add E0608Guillaume Gomez-1/+1
2017-06-05Auto merge of #42383 - estebank:candidate-newline, r=arielb1bors-6/+8
Use multiline note for trait suggestion
2017-06-04Separate suggestion in a `help` and a `note`Esteban Küber-2/+4
2017-06-02Use multiline note for trait suggestionEsteban Küber-4/+4
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-8/+3
Decompose Adjustment into smaller steps and remove the method map. The method map held method callee information for: * actual method calls (`x.f(...)`) * overloaded unary, binary, indexing and call operators * *every overloaded deref adjustment* (many can exist for each expression) That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with: * a desire to compose adjustments more freely * containing the autoderef logic better to avoid mutation within an inference snapshot * not creating `TyFnDef` types which are incompatible with the original one * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs` * to fix #3548 by explicitly writing autorefs for the RHS of comparison operators Individual commits tell their own story, of "atomic" changes avoiding breaking semantics. Future work based on this PR could include: * removing the signature from `TyFnDef`, now that it's always "canonical" * some questions of variance remain, as subtyping *still* treats the signature differently * moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits` * allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments * transitive coercions (e.g. reify or unsize after multiple steps of autoderef) r? @nikomatsakis
2017-05-31Use callsite's span for macro calls on suggestionEsteban Küber-0/+19
When suggesting an appropriate mutability for a macro call, use the call span instead of the expanded macro's span.
2017-06-01tests: fix fallout from changing the span of binop errors.Eduard-Mihai Burtescu-8/+3
2017-05-30Add new error codeGuillaume Gomez-1/+1
2017-05-27Add new error codes and update testsGuillaume Gomez-95/+95
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-78/+78
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-78/+78
See #33525 for details.
2017-05-17Add better error message when == operator is badly usedGuillaume Gomez-2/+2
2017-05-10Example usage of multiple suggestionsOliver Schneider-2/+2
2017-05-05Move logic to `is_representable` instead of climbing HIREsteban Küber-22/+21