Comments (3)
Pretty sure the underlying bug is #105495 (implied bounds from impl header are not used when checking assoc items for well-formedness)
from rust.
Error
Compiling playground v0.0.1 (/playground)
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:7:21
|
3 | impl<'a, T> Foo<'a, T> {
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
7 | let a = [0; Self::X];
| ^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
3 | impl<'a, T: 'a> Foo<'a, T> {
| ++++
For more information about this error, try `rustc --explain E0309`.
error: could not compile `playground` (lib) due to 1 previous error
from rust.
This is confusing but I don't think it is a bug, I am sure there is an open issue for it somewhere...
Maybe we could improve the diagnostics at least to explain "so that the type T
will meet its required lifetime bounds" (what required lifetime bounds?).
from rust.
Related Issues (20)
- unreachable!("state is never set to invalid values") is reached HOT 51
- ICE in the face of malformed code HOT 2
- array::IntoIter::new deprecation warning suggestion may lead to compilation error on 2015 and 2018 editions HOT 2
- CStr::from_ptr() crashes the program with a segfault when loading a string from memory after passing it in a global_asm!() function. HOT 6
- `tool::prepare_tool_cargo` should run `builder.ensure` automatically, based on tool mode HOT 4
- ICE: `adding a def'n for node-id NodeId(18) and def kind AnonConst but a previous def'n exists` HOT 1
- Doctests cannot recognize paths that lead to a type in the crate root HOT 2
- `./x check std` should not try to check `no_std` targets
- Tracking Issue for unsized const parameter types: `feature(unsized_const_params)`
- Some invalid cargo cache data leads to ICE
- Goofy suggestion when trying to use a raw ptr receiver and also the self keyword in the body HOT 1
- Tracking Issue for Contracts
- Vetting 3rd party crates for supply-chain-security issues
- Error when compiling `cdylib` using `JNI` HOT 13
- Did miri spot a concurrency bug taking RwLockWriteGuard? HOT 1
- dead-code false positive on named structs with a never field HOT 6
- compiletest: error if `-Cincremental` is passed in compile-flags in ui tests HOT 2
- compiletest: don't silently accept unsupported directives in test suites
- Ability to run cargo tests on main thread. HOT 1
- Type parameter captured inside closure may not live long enough HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.