8000 Rollup of 5 pull requests by Centril · Pull Request #65053 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 5 pull requests #65053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c845f3d
track the kind of async generator we are creating
nikomatsakis Sep 25, 2019
44e801a
thread down the body so we can check if this is an async fn body
nikomatsakis Sep 25, 2019
c8e5851
improved debug output
nikomatsakis Oct 2, 2019
f7ed53c
extract expected return type from `-> impl Future` obligation
nikomatsakis Oct 2, 2019
094f3a8
WIP tidy hir/lowering/expr.rs
nikomatsakis Oct 2, 2019
81cd596
WIP rebase for `shallow_resolve` call
nikomatsakis Oct 2, 2019
dce20bf
WIP fix tests
nikomatsakis Oct 2, 2019
3ae4abb
correct coercion comments
nikomatsakis Oct 2, 2019
a999132
improve comments on `GeneratorKind` and `AsyncGeneratorKind`
nikomatsakis Oct 2, 2019
5d64b3d
document `ret_coercion` and `ret_coercion_span`
nikomatsakis Oct 2, 2019
5fea1d2
document `shallow_resolve`
nikomatsakis Oct 2, 2019
3f277e1
s/`async` fn/`async fn`/
nikomatsakis Oct 2, 2019
a5cfc40
Avoid ICE on ReFree region from malformed code
estebank Oct 1, 2019
a96bce7
avoid using `skip_binder` and instead look for bound vars properly
nikomatsakis Oct 2, 2019
08a60ac
Calculate liveness for the same locals with and without -Zpolonius
8000 matthewjasper Sep 21, 2019
2180c24
Make lifetimes in constants live at the point of use
matthewjasper Sep 24, 2019
4a49351
add unsize slice-str coercion
nikomatsakis Oct 2, 2019
19c07cc
fix example (le sigh)
nikomatsakis Oct 2, 2019
de81565
review comments
estebank Oct 2, 2019
a8b2fe0
[RFC 2091] Add #[track_caller] attribute.
ayosec Jul 20, 2019
e9deff0
track_caller run-pass test, lint cleanup, PR review.
anp Oct 3, 2019
1e78d99
track_caller feature gate starts in 1.40.0.
anp Oct 3, 2019
da86007
Mark #![feature(track_caller)] as incomplete.
anp Oct 3, 2019
8ac9104
track_caller error numbers and text.
anp Oct 3, 2019
9e301d1
track_caller tests account for incomplete feature warning.
anp Oct 3, 2019
a807032
./x.py test --bless --compare-mode=nll
nikomatsakis Oct 3, 2019
d1310dc
proc_macro: Add `Span::mixed_site` exposing `macro_rules` hygiene
petrochenkov Sep 22, 2019
49c8463
Rollup merge of #64690 - petrochenkov:mixed, r=dtolnay
Centril Oct 3, 2019
1172cd4
Rollup merge of #64749 - matthewjasper:liveness-opt, r=nikomatsakis
Centril Oct 3, 2019
f22cd77
Rollup merge of #64938 - estebank:ice-ice-baby, r=matthewjasper
Centril Oct 3, 2019
83adae8
Rollup merge of #64999 - nikomatsakis:issue-60424-async-return-infere…
Centril Oct 3, 2019
18ce550
Rollup merge of #65037 - anp:track-caller, r=oli-obk
Centril Oct 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
track_caller error numbers and text.
  • Loading branch information
anp committed Oct 3, 2019
commit 8ac91048269d6e8be2f22f8894d6d257a74a66f3
20 changes: 10 additions & 10 deletions src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1727,16 +1727,6 @@ each method; it is not possible to annotate the entire impl with an `#[inline]`
attribute.
"##,

E0900: r##"
FIXME(anp): change error number
FIXME(anp): track_caller: invalid syntax
"##,

E0901: r##"
FIXME(anp): change error number
FIXME(anp): track_caller: no naked functions
"##,

E0522: r##"
The lang attribute is intended for marking special items that are built-in to
Rust itself. This includes special traits (like `Copy` and `Sized`) that affect
Expand Down Expand Up @@ -2244,6 +2234,15 @@ These attributes are meant to only be used by the standard library and are
rejected in your own crates.
"##,

E0736: r##"
#[track_caller] and #[naked] cannot be applied to the same function.

This is primarily due to ABI incompatibilities between the two attributes.
See [RFC 2091] for details on this and other limitations.

[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
"##,

;
// E0006, // merged with E0005
// E0101, // replaced with E0282
Expand Down Expand Up @@ -2306,4 +2305,5 @@ rejected in your own crates.
E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
E0727, // `async` generators are not yet supported
E0728, // `await` must be in an `async` function or block
E0735, // invalid track_caller application/syntax
}
4 changes: 2 additions & 2 deletions src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl CheckAttrVisitor<'tcx> {
struct_span_err!(
self.tcx.sess,
attr.span,
E0900,
E0735,
"attribute should be applied to function"
)
.span_label(item.span, "not a function")
Expand All @@ -153,7 +153,7 @@ impl CheckAttrVisitor<'tcx> {
struct_span_err!(
self.tcx.sess,
attr.span,
E0901,
E0736,
"cannot use `#[track_caller]` with `#[naked]`",
)
.emit();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn check_trait_item(tcx: TyCtxt<'_>, def_id: DefId) {
struct_span_err!(
tcx.sess,
attr.span,
E0903,
E0738,
"`#[track_caller]` is not supported for trait items yet."
).emit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
struct_span_err!(
8000 tcx.sess,
attr.span,
E0902,
E0737,
"rust ABI is required to use `#[track_caller]`"
).emit();
}
Expand Down
16 changes: 10 additions & 6 deletions src/librustc_typeck/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4908,14 +4908,18 @@ The `Box<...>` ensures that the result is of known size,
and the pin is required to keep it in the same place in memory.
"##,

E0902: r##"
FIXME(anp): change error number
FIXME(anp): track_caller: require Rust ABI to use track_caller
E0737: r##"
#[track_caller] requires functions to have the "Rust" ABI for passing caller
location. See [RFC 2091] for details on this and other restrictions.

[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
"##,

E0903: r##"
FIXME(anp): change error number
FIXME(anp): track_caller: can't apply in traits
E0738: r##"
#[track_caller] cannot be applied to trait methods. See [RFC 2091]
for details on this and other restrictions.

[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
"##,

;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0902]: rust ABI is required to use `#[track_caller]`
error[E0737]: rust ABI is required to use `#[track_caller]`
--> $DIR/error-with-invalid-abi.rs:3:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0902`.
For more information about this error, try `rustc --explain E0737`.
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2091-track-caller/error-with-naked.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0901]: cannot use `#[track_caller]` with `#[naked]`
error[E0736]: cannot use `#[track_caller]` with `#[naked]`
--> $DIR/error-with-naked.rs:3:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0901`.
For more information about this error, try `rustc --explain E0736`.
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2091-track-caller/error-with-trait-fns.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0903]: `#[track_caller]` is not supported for trait items yet.
error[E0738]: `#[track_caller]` is not supported for trait items yet.
--> $DIR/error-with-trait-fns.rs:4:5
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0903`.
For more information about this error, try `rustc --explain E0738`.
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2091-track-caller/only-for-fns.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0900]: attribute should be applied to function
error[E0735]: attribute should be applied to function
--> $DIR/only-for-fns.rs:3:1
|
LL | #[track_caller]
Expand All @@ -8,4 +8,4 @@ LL | struct S;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0900`.
For more information about this error, try `rustc --explain E0735`.
0