| Age | Commit message (Collapse) | Author | Lines |
|
Warn the ecosystem of the pending intent-to-disallow in #49799.
|
|
Remove unstable `macro_reexport`
It's subsumed by `feature(use_extern_macros)` and `pub use`
cc https://github.com/rust-lang/rust/issues/35896
closes https://github.com/rust-lang/rust/issues/29638
closes https://github.com/rust-lang/rust/issues/38951
|
|
Module experiments: Add one more prelude layer for extern crate names passed with `--extern`
Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183
When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order:
- local variables
- items in unnamed blocks
- items in the current module
- :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude")
- standard library prelude (`Vec`, `drop`)
- language prelude (built-in types like `u8`, `str`, etc)
The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types.
This is a one-time breaking change, that's why it would be nice to run this through crater.
Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).
|
|
|
|
|
|
It's subsumed by `feature(use_extern_macros)` and `pub use`
|
|
Remove some unused code
|
|
Add force-frame-pointer flag to allow control of frame pointer ommision
Rebase of #47152 plus some changes suggested by https://github.com/rust-lang/rust/issues/48785.
Fixes #11906
r? @nikomatsakis
|
|
|
|
This reworks the force-frame-pointer PR to explicitly only consider the
value of the flag if it is provided, and use a target default otherwise.
Something that was tried but not kept was renaming the flag to
`frame-pointer`, because for flag `frame-pointer=no`, there is no
guarante, that LLVM will elide *all* the frame pointers; oposite of what
the literal reading of the flag would suggest.
|
|
We apparently used to generate bad/incomplete debug info causing
debuggers not to find symbols of stack allocated variables. This was
somehow worked around by having frame pointers.
With the current codegen, this seems no longer necessary, so we can
remove the code that force-enables frame pointers whenever debug info
is requested.
Since certain situations, like profiling code profit from having frame
pointers, we add a -Cforce-frame-pointers flag to always enable frame
pointers.
Fixes #11906
|
|
Mark functions returning uninhabited types as noreturn
|
|
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)
r? @nikomatsakis
|
|
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
|
|
Display correct unused field suggestion for nested struct patterns
Extends https://github.com/rust-lang/rust/pull/47922 by checking more sophisticated patterns (e.g. references, slices, etc.).
Before:
```
warning: unused variable: `bar`
--> src/main.rs:37:21
|
37 | &Foo::Bar { bar } => true,
| ^^^ help: consider using `_bar` instead
|
= note: #[warn(unused_variables)] on by default
```
After:
```
warning: unused variable: `bar`
--> src/main.rs:37:21
|
37 | &Foo::Bar { bar } => true,
| ^^^ help: try ignoring the field: `bar: _`
|
= note: #[warn(unused_variables)] on by default
```
Fixes #50303.
r? @estebank
|
|
Add a few more tests for proc macro feature gating
|
|
Make `Vec::new` a `const fn`
`RawVec::empty/_in` are a hack. They're there because `if size_of::<T> == 0 { !0 } else { 0 }` is not allowed in `const` yet. However, because `RawVec` is unstable, the `empty/empty_in` constructors can be removed when #49146 is done...
|
|
|
|
|
|
rustdoc: Fix links to constants in external crates
r? @GuillaumeGomez
|
|
Add a ui test for an incorrect Result success type in a #[test]
cc https://github.com/rust-lang/rust/issues/48854#issuecomment-384730601
r? @nikomatsakis
|
|
|
|
|
|
Warn on pointless #[derive] in more places
This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly.
closes #49934
|
|
|
|
|
|
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly.
closes #49934
|
|
|
|
|
|
Improve error message for #[repr(align=x)]
Before:
```
error[E0552]: unrecognized representation hint
--> src/main.rs:1:8
|
1 | #[repr(align="8")]
| ^^^^^^^^^
```
After:
```
error[E0693]: incorrect `repr(align)` attribute format
--> src/main.rs:1:8
|
2 | #[repr(align="8")]
| ^^^^^^^^^ help: use parentheses instead: `align(8)`
```
Fixes #50314.
|
|
|
|
Allow MIR borrowck to catch unused mutable locals
Fixes #47279.
r? @nikomatsakis
|
|
This is in the matter of RFC 1940 and tracking issue #43302.
|
|
Fix ICE #48984
* ~~fbf6423 The tail type was not normalized.~~
* https://github.com/rust-lang/rust/commit/d0839d5680d2a51785eeb0811cf3e2beba90eacb The method had a wrong assumption that something whose parent is a trait is an associated item. Fixes #48984.
|
|
|
|
Previously the features specified to LLVM via `-C target-feature` were only
reflected in the `TargetMachine` but this change *also* reflects these and the
base features inside each function itself. This change matches clang and...
Closes rust-lang-nursery/stdsimd#427
|
|
|
|
Emit range metadata on calls returning scalars (fixes #50157)
|
|
Don't feature gate bang macros on 'proc_macro_path_invoc'.
Fixes oversight from #50120.
|
|
'label can start expressions
```Rust
let foo = 'label: loop { break 'label 42; };
```
is valid Rust code.
|
|
|
|
|
|
Added warning for unused arithmetic expressions
The compiler now displays a warning when a binary arithmetic operation is evaluated but not used. This resolves #50124 by following the instructions outlined in the issue. The changes are as follows:
- Added new pattern matching for unused arithmetic expressions in `src/librustc_lint/unused.rs`
- Added `#[must_use]` attributes to the binary operation methods in `src/libcore/internal_macros.rs`
- Added `#[must_use]` attributes to the non-assigning binary operators in `src/libcore/ops/arith.rs`
|
|
It have returned `Some` for constants in a trait definition,
and `Instance::resolve` called `tcx.associated_item` for them,
causing ICE.
|
|
Access individual fields of tuples, closures and generators on drop.
Fixes #48623, by extending the change in #47917 to closures. Also does this for tuples and generators for consistency.
Enums are unchanged because there is now way to borrow `*enum.field` without borrowing `enum.field` at the moment, so any error would be reported when the enum goes out of scope. Unions aren't changed because unions they don't automatically drop their fields.
r? @nikomatsakis
|
|
Don't ICE on tuple struct ctor with incorrect arg count
Fix #49560.
|
|
|
|
Allow #[inline] on closures
Fixes #49632
|
|
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
|
|
|